Skip to main content
Home

A TypeScript utility library providing a comprehensive set of functions to validate, verify, and perform checks on nullish.

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
a year ago (2.0.0)

@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

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@checker/nullish

Import symbol

import * as nullish from "@checker/nullish";
or

Import directly with a jsr specifier

import * as nullish from "jsr:@checker/nullish";

Add Package

pnpm i jsr:@checker/nullish
or (using pnpm 10.8 or older)
pnpm dlx jsr add @checker/nullish

Import symbol

import * as nullish from "@checker/nullish";

Add Package

yarn add jsr:@checker/nullish
or (using Yarn 4.8 or older)
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";