UNPKG

@lou.codes/predicates

Version:
19 lines (18 loc) 444 B
/** * 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 const isFalsy = input => !input;