@fiquu/is

Functional, dependency-free check library for Node.js and the browser (transpiled).
Installation
npm i @fiquu/is
Usage
Import by category:
import { isString, isNumber } from '@fiquu/is/type';
import { isIntlPhone } from '@fiquu/is/regexp';
isString('foo');
isString(2);
isNumber(1);
isNumber('1');
intlPhone('+12015556677');
intlPhone('1234');
Or just what you need:
import { isIntlPhone } from '@fiquu/is/regexp/intl-phone';
import { isString } from '@fiquu/is/type/string';
import { isNumber } from '@fiquu/is/type/number';
isString('foo');
isSstring(2);
isNumber(1);
isNumber('1');
isIntlPhone('+12015556677');
isIntlPhone('1234');
Multiple Values
If you need to check multiple values, then use the some and every array methods:
import { isString, isNumber } from '@fiquu/is/type';
['foo', 'bar'].every(isString);
[1, 2, 'baz'].every(isString);
[1, 2, 3, 4].every(isNumber);
[1, 2, 'foo'].every(isNumber);
['foo', 'bar', true].some(isString);
[1, 2, 'baz'].some(isString);
[1, null, '3'].some(isNumber);
[false, null, 'foo'].some(isNumber);
Documentation
Please see the documentation page for more details.