Type Alias IsUndefined<T, $O>

IsUndefined<T, $O>: $SpecialType<T, $MergeOptions<$O, {
    $else: IsUndefined.$<T, $O>;
    $then: $ResolveBranch<T, $O, [$Else]>;
}>>

🎭 predicate

Validate if T is undefined.

Type Parameters

type R = IsUndefined<undefined> // true

type R = IsUndefined<never> // false
type R = IsUndefined<unknown> // false
type R = IsUndefined<string | boolean> // false

type R = IsUndefined<string | undefined> // boolean

🔢 customize

Filter to ensure T is undefined, otherwise returns never.

type R = IsUndefined<undefined, { selection: 'filter' }> // undefined

type R = IsUndefined<never, { selection: 'filter' }> // never
type R = IsUndefined<unknown, { selection: 'filter' }> // never
type R = IsUndefined<string | boolean, { selection: 'filter' }> // never

type R = IsUndefined<string | undefined> // undefined

🔢 customize:

Disable distribution of union types.

type R = IsUndefined<undefined | 1> // boolean
type R = IsUndefined<undefined | 1, { distributive: false }> // false

🔢 customize

Use unique branch identifiers to allow precise processing of the result.

type R = IsUndefined<undefined, $SelectionBranch> // $Then
type R = IsUndefined<string, $SelectionBranch> // $Else