Sha256: 309586820e31406ed70bb03ea8bca88b7ec15215e82d0aa85392da25d0b68630

Contents?: true

Size: 528 Bytes

Versions: 28

Compression:

Stored size: 528 Bytes

Contents

import type {IsUnknown} from './is-unknown';

/**
An if-else-like type that resolves depending on whether the given type is `unknown`.

@see {@link IsUnknown}

@example
```
import type {IfUnknown} from 'type-fest';

type ShouldBeTrue = IfUnknown<unknown>;
//=> true

type ShouldBeBar = IfUnknown<'not unknown', 'foo', 'bar'>;
//=> 'bar'
```

@category Type Guard
@category Utilities
*/
export type IfUnknown<T, TypeIfUnknown = true, TypeIfNotUnknown = false> = (
	IsUnknown<T> extends true ? TypeIfUnknown : TypeIfNotUnknown
);

Version data entries

28 entries across 28 versions & 2 rubygems

Version Path
clapton-0.0.26 lib/clapton/javascripts/node_modules/type-fest/source/if-unknown.d.ts
clapton-0.0.25 lib/clapton/javascripts/node_modules/type-fest/source/if-unknown.d.ts
clapton-0.0.24 lib/clapton/javascripts/node_modules/type-fest/source/if-unknown.d.ts
clapton-0.0.23 lib/clapton/javascripts/node_modules/type-fest/source/if-unknown.d.ts
clapton-0.0.22 lib/clapton/javascripts/node_modules/type-fest/source/if-unknown.d.ts
clapton-0.0.21 lib/clapton/javascripts/node_modules/type-fest/source/if-unknown.d.ts
clapton-0.0.20 lib/clapton/javascripts/node_modules/type-fest/source/if-unknown.d.ts
clapton-0.0.19 lib/clapton/javascripts/node_modules/type-fest/source/if-unknown.d.ts
clapton-0.0.18 lib/clapton/javascripts/node_modules/type-fest/source/if-unknown.d.ts
clapton-0.0.17 lib/clapton/javascripts/node_modules/type-fest/source/if-unknown.d.ts
clapton-0.0.16 lib/clapton/javascripts/node_modules/type-fest/source/if-unknown.d.ts
clapton-0.0.15 lib/clapton/javascripts/node_modules/type-fest/source/if-unknown.d.ts
clapton-0.0.14 lib/clapton/javascripts/node_modules/type-fest/source/if-unknown.d.ts
clapton-0.0.13 lib/clapton/javascripts/node_modules/type-fest/source/if-unknown.d.ts
clapton-0.0.12 lib/clapton/javascripts/node_modules/type-fest/source/if-unknown.d.ts
clapton-0.0.11 lib/clapton/javascripts/node_modules/type-fest/source/if-unknown.d.ts
clapton-0.0.10 lib/clapton/javascripts/node_modules/type-fest/source/if-unknown.d.ts
clapton-0.0.9 lib/clapton/javascripts/node_modules/type-fest/source/if-unknown.d.ts
clapton-0.0.8 lib/clapton/javascripts/node_modules/type-fest/source/if-unknown.d.ts
clapton-0.0.7 lib/clapton/javascripts/node_modules/type-fest/source/if-unknown.d.ts