/** Returns a boolean for whether the given type includes `undefined`. Note: `any` returns `true`; `never`, `unknown`, and `void` return `false`. Unions are normalized before checking for an `undefined` member, rather than merely accepting an `undefined` value. @example ```ts import type {IsOptional} from 'type-fest'; type A = IsOptional; //=> false type B = IsOptional; //=> true type C = IsOptional; //=> false type D = IsOptional; //=> true ``` @category Type Guard @category Utilities */ // Extraction yields `undefined`, `never`, or `any`; only the first and last include `undefined`. export type IsOptional = undefined extends Extract ? true : false; export {};