import { isType } from '../internals'; /** * Evaluates if the specified type is `undefined`. * @example * type A = isUndefined; * // ^? true * type B = isUndefined; * // ^? false * type C = isUndefined; * // ^? false */ export type isUndefined = isType; /** * Evaluates if the specified type is `null`. * @example * type A = isNull; * // ^? true * type B = isNull; * // ^? false * type C = isNull; * // ^? false */ export type isNull = isType; /** remove undefined from type */ export type nonUndefined = T extends undefined ? never : T; /** remove null from type */ export type nonNull = T extends null ? never : T; /** * A utility type that substitutes a default type when the provided type is undefined. * @example * type A = defaultOnUndefined; // Result: string * type B = defaultOnUndefined; // Result: number */ export type defaultOnUndefined = isUndefined extends true ? Default : Type;