Sha256: 0f2c77683296ca2d0e0bee84f8aa944a05df23bc4c5b5fef31dda757e75f660f

Contents?: true

Size: 498 Bytes

Versions: 28

Compression:

Stored size: 498 Bytes

Contents

import type {IsNever} from './is-never';

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

@see {@link IsNever}

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

type ShouldBeTrue = IfNever<never>;
//=> true

type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
//=> 'bar'
```

@category Type Guard
@category Utilities
*/
export type IfNever<T, TypeIfNever = true, TypeIfNotNever = false> = (
	IsNever<T> extends true ? TypeIfNever : TypeIfNotNever
);

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-never.d.ts
clapton-0.0.25 lib/clapton/javascripts/node_modules/type-fest/source/if-never.d.ts
clapton-0.0.24 lib/clapton/javascripts/node_modules/type-fest/source/if-never.d.ts
clapton-0.0.23 lib/clapton/javascripts/node_modules/type-fest/source/if-never.d.ts
clapton-0.0.22 lib/clapton/javascripts/node_modules/type-fest/source/if-never.d.ts
clapton-0.0.21 lib/clapton/javascripts/node_modules/type-fest/source/if-never.d.ts
clapton-0.0.20 lib/clapton/javascripts/node_modules/type-fest/source/if-never.d.ts
clapton-0.0.19 lib/clapton/javascripts/node_modules/type-fest/source/if-never.d.ts
clapton-0.0.18 lib/clapton/javascripts/node_modules/type-fest/source/if-never.d.ts
clapton-0.0.17 lib/clapton/javascripts/node_modules/type-fest/source/if-never.d.ts
clapton-0.0.16 lib/clapton/javascripts/node_modules/type-fest/source/if-never.d.ts
clapton-0.0.15 lib/clapton/javascripts/node_modules/type-fest/source/if-never.d.ts
clapton-0.0.14 lib/clapton/javascripts/node_modules/type-fest/source/if-never.d.ts
clapton-0.0.13 lib/clapton/javascripts/node_modules/type-fest/source/if-never.d.ts
clapton-0.0.12 lib/clapton/javascripts/node_modules/type-fest/source/if-never.d.ts
clapton-0.0.11 lib/clapton/javascripts/node_modules/type-fest/source/if-never.d.ts
clapton-0.0.10 lib/clapton/javascripts/node_modules/type-fest/source/if-never.d.ts
clapton-0.0.9 lib/clapton/javascripts/node_modules/type-fest/source/if-never.d.ts
clapton-0.0.8 lib/clapton/javascripts/node_modules/type-fest/source/if-never.d.ts
clapton-0.0.7 lib/clapton/javascripts/node_modules/type-fest/source/if-never.d.ts