Is Never

Medium
never type
distributive conditional types

Description:

Implement a type IsNever, which takes input type T. If the type of resolves to never, return true, otherwise false.

For example:

// expected to be true type A = IsNever<never> // all cases below expected false type B = IsNever<undefined> type C = IsNever<null> type D = IsNever<[]> type E = IsNever<number>

Code

Loading...