Type Alias HasUndefined<T, $O>

HasUndefined<T, $O>: $ResolveBranch<T, $O, [IsUndefined<T> extends false
    ? $Else
    : $Then]>

🎭 predicate

Validate if T is undefined or an union with undefined.

Type Parameters

type R = HasUndefined<undefined> // true
type R = HasUndefined<undefined | 1> // true

type R = HasUndefined<number> // false

🔢 customize

Filter to ensure T is undefined or an union with undefined, otherwise returns never.

type R = HasUndefined<undefined> // undefined
type R = HasUndefined<undefined | 1> // undefined | 1

type R = HasUndefined<number> // never

🔢 customize

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

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