Checks if a given type T is never. The never type represents a value that never occurs, for example a function that always errors out.
T
never
true if T is never, otherwise false.
true
false
type Never = IsNever<never>; => true type NotNever = IsNever<string>; => false Copy
type Never = IsNever<never>; => true type NotNever = IsNever<string>; => false
Checks if a given type
T
isnever
. Thenever
type represents a value that never occurs, for example a function that always errors out.