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

1.0.3 • Public • Published

is-null

Determine if a value is Null

install

npm i @silen/is-null

api

  • declare function isNull(val: any): boolean;

usage

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

console.log(isNull(new Buffer(4)));
console.log(isNull(Buffer.alloc(4)));
console.log(isNull(undefined));
console.log(isNull(null));
console.log(isNull(''));
console.log(isNull(true));
console.log(isNull(0));
console.log(isNull(1));
console.log(isNull(1.0));
console.log(isNull('string'));
console.log(isNull({}));
console.log(isNull(function foo() {}));
console.log(isNull(Symbol()));
console.log(isNull(new Set));
console.log(isNull(new Map));
console.log(isNull(new WeakMap));
console.log(isNull(new WeakSet));

// or
console.log(window.Type.isNull(new WeakSet));

This is a demo for testing the usage of isNull from @silen/is-null module. You can try the others and do likewise.

others

Package Sidebar

Install

npm i @silen/is-null

Weekly Downloads

0

Version

1.0.3

License

MIT

Unpacked Size

8.07 kB

Total Files

9

Last publish

Collaborators

  • silentsun