import type {IsAny} from './is-any.d.ts'; /** Returns a boolean for whether the given type is `null`. Checks unions as a whole. Returns `false` for `any`, `never`, and `unknown`. @example ``` import type {IsNull} from 'type-fest'; type NonNullFallback = IsNull extends true ? Fallback : T; type Example1 = NonNullFallback; //=> string type Example2 = NonNullFallback; //=> number ``` @category Type Guard @category Utilities */ // `any` and `never` are checked first, because they are assignable to `null` and would otherwise answer `true`. export type IsNull = IsAny extends true ? false : [Value] extends [never] ? false : [Value] extends [null] ? true : false; export {};