type R = IsNull<null> // true
type R = IsNull<never> // false
type R = IsNull<unknown> // false
type R = IsNull<string | boolean> // false
type R = IsNull<string | null> // boolean
🔢 customize
Filter to ensure T
is null
, otherwise returns never
.
type R = IsNull<null, { selection: 'filter' }> // null
type R = IsNull<never, { selection: 'filter' }> // never
type R = IsNull<unknown, { selection: 'filter' }> // never
type R = IsNull<string | boolean, { selection: 'filter' }> // never
type R = IsNull<string | null> // null
🔢 customize:
Disable distribution of union types.
type R = IsNull<null | 1> // boolean
type R = IsNull<null | 1, { distributive: false }> // false
🔢 customize
Use unique branch identifiers to allow precise processing of the result.
🎭 predicate
Validate if
T
isnull
.