🎭 predicate 🔢 customize 🩳 shortcut
Validate if T is either exactly any or exactly never.
T
any
never
type R = IsAnyOrNever<any> // $Thentype R = IsAnyOrNever<never> // $Thentype R = IsAnyOrNever<1> // $Elsetype R = IsAnyOrNever<unknown> // $Elsetype R = IsAnyOrNever<never, $SelectionPredicate> // truetype R = IsAnyOrNever<'a', $SelectionPredicate> // false Copy
type R = IsAnyOrNever<any> // $Thentype R = IsAnyOrNever<never> // $Thentype R = IsAnyOrNever<1> // $Elsetype R = IsAnyOrNever<unknown> // $Elsetype R = IsAnyOrNever<never, $SelectionPredicate> // truetype R = IsAnyOrNever<'a', $SelectionPredicate> // false
🎭 predicate 🔢 customize 🩳 shortcut
Validate if
T
is either exactlyany
or exactlynever
.