1.0.6 • Published 3 years ago

@necho/js-type v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

is

A javascript type checker

is.array([]) //=> true

isNumber('') //=> false

Installation

Using npm

$ npm install @necho/js-type

Using yarn

$ yarn add @necho/js-type

Usage

Commonjs usage

const is = require('@necho/js-type').default;

is.number(7) //=> true

ES6 usage

import is from '@necho/js-type';

is.number(7) //=> true

Using semantic function

import { isArray } from '@necho/js-type';

isArray('') //=> false

API

is.{method}

Basic

.string(value)

.number(value)

.boolean(value)

.array(value)

.object(value)

.date(value)

.symbol(value)

Boolean

.false(value)

.true(value)

Number

.infinite(value)

.nan(value)

.even(value)

.odd(value)

Nullish

.null(value) / .nil(value)

.undefined(value) / .undef(value)

.defined(value)

Function

.function(value)

.normalFunction(value)

.generatorFunction(value)

.asyncFunction(value)

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago