UNPKG

shelving

Version:

Toolkit for using data in JavaScript.

14 lines (13 loc) 693 B
import type { AnyCaller } from "./function.js"; /** Function that always returns undefined. */ export declare function getUndefined(): undefined; /** Is a value undefined? */ export declare function isUndefined(value: unknown): value is undefined; /** Is a value defined? */ export declare function isDefined<T>(value: T | undefined): value is T; /** Is a value defined? */ export declare const notUndefined: typeof isDefined; /** Assert that a value is not `undefined` */ export declare function assertDefined<T>(value: T | undefined, caller?: AnyCaller): asserts value is T; /** Get a defined value. */ export declare function requireDefined<T>(value: T | undefined, caller?: AnyCaller): T;