Type Alias IsAnyOrNever<T, $O>

IsAnyOrNever<T, $O>: IsNever<T, {
    $else: IsAny<T, $O>;
    $then: $O["$then"];
}>

🎭 predicate 🔢 customize 🩳 shortcut

Validate if T is either exactly any or exactly never.

Type Parameters

type R = IsAnyOrNever<any> // $Then
type R = IsAnyOrNever<never> // $Then

type R = IsAnyOrNever<1> // $Else
type R = IsAnyOrNever<unknown> // $Else

type R = IsAnyOrNever<never, $SelectionPredicate> // true
type R = IsAnyOrNever<'a', $SelectionPredicate> // false