1.0.8 • Published 5 years ago
@jsxtools/is-type v1.0.8
is-type
is-type is a collection of functions that return whether a value is a certain type.
It is 280 bytes (173 gzipped).
Installation
npm install @jsxtools/is-type
Usage
import { isArray, isBoolean, isNumber, isObject, isString } from '@jsxtools/is-type';
isArray(''); // false
isArray([]); // true
isArray({}); // false
isBoolean(false); // true
isBoolean(0); // false
isBoolean(!0); // true
isNumber(0); // true
isNumber(Infinity); // false
isNumber(NaN); // false
isNumber('0'); // false
isObject({}); // true
isObject([]); // true
isObject(''); // false
isString(''); // true
isString([]); // false
isString({}); // false