UNPKG

type-fns

Version:

A set of types, type checks, and type guards for simpler, safer, and easier to read code.

12 lines (11 loc) 280 B
/** * narrows the type to remove undefined * * ref * - https://stackoverflow.com/a/63045455/3068233 */ export type NotNull<T> = T extends null ? never : T; /** * checks whether the value is not undefined */ export declare const isNotNull: <T>(val: T) => val is NotNull<T>;