UNPKG

@lou.codes/predicates

Version:
20 lines (19 loc) 517 B
import type { Falsy } from "@lou.codes/types"; /** * Check if given `input` is falsy (0, NaN, "", false, or nullish). * * @category Common * @example * ```typescript * isFalsy(false); // true * isFalsy(0); // true * isFalsy(NaN); // true * isFalsy(""); // true * isFalsy(null); // true * isFalsy(undefined); // true * isFalsy(42); // false * ``` * @param input Value to check. * @returns Returns `true` if falsy, `false` otherwise. */ export declare const isFalsy: (input: unknown) => input is Falsy;