@lou.codes/predicates
Version:
🧐 Predicate util functions
19 lines (18 loc) • 427 B
JavaScript
import { isNull } from "./isNull.js";
/**
* Check if `input` is `undefined` or `null`.
*
* @category Primitives
* @example
* ```typescript
* isNullish(undefined); // true
* isNullish(null); // true
* isNullish(""); // false
* isNullish(42); // false
* ```
* @returns `true` if nullish, `false` otherwise.
*/
export const isNullish = (
// eslint-disable-next-line unicorn/no-null
input = null,
) => isNull(input);