A TypeScript utility library providing a comprehensive set of functions to validate, verify, and perform checks on nullish.
@checker/nullish
A TypeScript utility library providing a comprehensive set of functions to
validate, verify, and perform checks on nullish. This package provides tools to
help you manage null, undefined, and nullish values in your code with ease.
Installation
NPM:
npx jsr add @checker/nullish
PNPM:
pnpm dlx jsr add @checker/nullish
Deno:
deno add @checker/nullish
Yarn:
yarn dlx jsr add @checker/nullish
Bun:
bunx jsr add @checker/nullish
Functions
check_is_null
Checks if the given value is strictly null.
check_is_null(null); // true check_is_null(undefined); // false
check_is_not_null
Checks if the given value is not strictly null.
check_is_not_null(undefined); // true check_is_not_null(null); // false
check_is_undefined
Checks if the given value is strictly undefined.
check_is_undefined(undefined); // true check_is_undefined(null); // false
check_is_not_undefined
Checks if the given value is not strictly undefined.
check_is_not_undefined(null); // true check_is_not_undefined(undefined); // false
check_is_nullish
Checks if the given value is nullish (either null or undefined).
check_is_nullish(null); // true check_is_nullish(undefined); // true check_is_nullish(0); // false
check_is_not_nullish
Checks if the given value is not nullish (neither null nor undefined).
check_is_not_nullish(0); // true check_is_not_nullish(null); // false check_is_not_nullish(undefined); // false
License
MIT License
Add Package
deno add jsr:@checker/nullish
Import symbol
import * as nullish from "@checker/nullish";
Import directly with a jsr specifier
import * as nullish from "jsr:@checker/nullish";
Add Package
pnpm i jsr:@checker/nullish
pnpm dlx jsr add @checker/nullish
Import symbol
import * as nullish from "@checker/nullish";
Add Package
yarn add jsr:@checker/nullish
yarn dlx jsr add @checker/nullish
Import symbol
import * as nullish from "@checker/nullish";
Add Package
vlt install jsr:@checker/nullish
Import symbol
import * as nullish from "@checker/nullish";
Add Package
npx jsr add @checker/nullish
Import symbol
import * as nullish from "@checker/nullish";
Add Package
bunx jsr add @checker/nullish
Import symbol
import * as nullish from "@checker/nullish";