@zerodep/is-null
TypeScript icon, indicating that this package has built-in type declarations

2.0.7 • Public • Published

@zerodep/is-null

version language types license

CodeFactor Known Vulnerabilities

A simple, performant utility to determine if a value is null.

Full documentation is available at the zerodep.app page.

Examples

All @zerodep packages support both ESM and CJS.

import { isNull } from '@zerodep/is-null';
// or
const { isNull } = require('@zerodep/is-null');

Positive Response

isNull(null); // true

Negative Response

isNull(['a', 'b', 'c']); // false
isNull(1000n); // false
isNull(true); // false
isNull(new Date()); // false
isNull(''); // false
isNull(new Error('message')); // false
isNull(3.14); // false
isNull(() => 'function'); // false
isNull(42); // false
isNull(
  new Map([
    ['a', 1],
    ['b', 2],
  ])
); // false
isNull({ an: 'object' }); // false
isNull(new Promise(() => {})); // false
isNull(/[regex]+/gi); // false
isNull(new Set([1, 2, 3])); // false
isNull('a string'); // false
isNull(Symbol()); // false
isNull(new Int32Array(2)); // false
isNull(undefined); // false

Readme

Keywords

Package Sidebar

Install

npm i @zerodep/is-null

Homepage

zerodep.app

Weekly Downloads

1

Version

2.0.7

License

MIT

Unpacked Size

4.19 kB

Total Files

7

Last publish

Collaborators

  • cdepage