🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@fiquu/is

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fiquu/is

Small check library for Node.js and the browser.

latest
Source
npmnpm
Version
3.0.2
Version published
Maintainers
1
Created
Source

@fiquu/is

Build Status GitHub GitHub last commit npm (scoped) npm

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'); // true
isString(2); // false

isNumber(1); // true
isNumber('1'); // false

intlPhone('+12015556677'); // true
intlPhone('1234'); // false

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'); // true
isSstring(2); // false

isNumber(1); // true
isNumber('1'); // false

isIntlPhone('+12015556677'); // true
isIntlPhone('1234'); // false

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); // true
[1, 2, 'baz'].every(isString); // false

[1, 2, 3, 4].every(isNumber); // true
[1, 2, 'foo'].every(isNumber); // false

['foo', 'bar', true].some(isString); // true
[1, 2, 'baz'].some(isString); // false

[1, null, '3'].some(isNumber); // true
[false, null, 'foo'].some(isNumber); // false

Documentation

Please see the documentation page for more details.

Keywords

is

FAQs

Package last updated on 11 May 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts