ChanWahFung / is-what

Tiny javescript type check functions!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@wahfung/is-what

Tiny javescript type check functions!

Install

npm install @wahfung/is-what

Usage

Type check functions:

import {isString, isUndefined, isArray} from '@wahfung/is-what'

isString('') // true
isNumber(10) // true
isBoolean(false) // true
isUndefined(undefined) // true
isNull(null) // true
isArray([]) // true
isObject({}) // true

Number check functions:

import {isNegativeNumber, isNegativeZero} from '@wahfung/is-what'

isPositiveNumber(1) // true
isNegativeNumber(-1) // true
isPostiveZero(0) // true
isNegativeZero(-0) // true

About

Tiny javescript type check functions!