type R = IsNotUndefined<undefined> // false
type R = IsNotUndefined<never> // true
type R = IsNotUndefined<unknown> // true
type R = IsNotUndefined<string | boolean> // true
🔢 customize
Filter to ensure T
is not undefined
, otherwise returns never
.
type R = IsNotUndefined<undefined, { selection: 'filter' }> // never
type R = IsNotUndefined<never, { selection: 'filter' }> // never
type R = IsNotUndefined<unknown, { selection: 'filter' }> // unknown
type R = IsNotUndefined<string | boolean, { selection: 'filter' }> // string | boolean
🔢 customize
Disable distribution of union types.
type R = IsNotUndefined<undefined | 1> // boolean
type R = IsNotUndefined<undefined | 1, { distributive: false }> // true
🔢 customize
Use unique branch identifiers to allow precise processing of the result.
type R = IsNotUndefined<string, $SelectionBranch> // $Then
type R = IsNotUndefined<undefined, $SelectionBranch> // $Else
Generated using TypeDoc
🎭 predicate
Validate if
T
is notundefined
.