-
-
Notifications
You must be signed in to change notification settings - Fork 730
Expand file tree
/
Copy pathif-any.d.ts
More file actions
28 lines (20 loc) · 584 Bytes
/
Copy pathif-any.d.ts
File metadata and controls
28 lines (20 loc) · 584 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import type {IsAny} from './is-any.d.ts';
/**
An if-else-like type that resolves depending on whether the given type is `any`.
@deprecated This type will be removed in the next major version. Use the {@link If} type instead.
@see {@link IsAny}
@example
```
import type {IfAny} from 'type-fest';
type ShouldBeTrue = IfAny<any>;
//=> true
type ShouldBeBar = IfAny<'not any', 'foo', 'bar'>;
//=> 'bar'
```
@category Type Guard
@category Utilities
*/
export type IfAny<T, TypeIfAny = true, TypeIfNotAny = false> = (
IsAny<T> extends true ? TypeIfAny : TypeIfNotAny
);
export {};