🎭 predicate
Validate if T is exactly unknown.
T
unknown
type R = IsUnknown<unknown> // truetype R = IsUnknown<number> // falsetype R = IsUnknown<never> // false Copy
type R = IsUnknown<unknown> // truetype R = IsUnknown<number> // falsetype R = IsUnknown<never> // false
🔢 customize
Filter to ensure T is exactly unknown.
type R = IsUnknown<unknown, { selection: 'filter' }> // unknowntype R = IsUnknown<number, { selection: 'filter' }> // nevertype R = IsUnknown<never, { selection: 'filter' }> // never Copy
type R = IsUnknown<unknown, { selection: 'filter' }> // unknowntype R = IsUnknown<number, { selection: 'filter' }> // nevertype R = IsUnknown<never, { selection: 'filter' }> // never
Use unique branch identifiers to allow precise processing of the result.
type R = IsUnknown<unknown, $SelectionBranch> // $Thentype R = IsUnknown<string, $SelectionBranch> // $Else Copy
type R = IsUnknown<unknown, $SelectionBranch> // $Thentype R = IsUnknown<string, $SelectionBranch> // $Else
🎭 predicate
Validate if
T
is exactlyunknown
.