0.2.1 • Published 8 years ago
@jasonxia23/is v0.2.1
IS
Install
# Using npm
npm install @jasonxia23/is
# Using yarn
yarn add @jasonxia23/isNote: Updating your npm and clean the cache may fix the errors during installing.
npm install -g npm && npm clean cacheUsage
Library provide a case-insensitive API, which means you can use either isObject or isobject to check whether it is a object.
var is = require('@jasonxia23/is')
is.Object({})
// => true
is.Array([])
// => true
is.Promise(new Promise(() => {}))
// => true
is.Json('{}')
// => true
is.RegExp(/\d/)
// => trueAPI
Basic
is.Null
is.Undefined
is.Defined
is.String
is.Number
is.Boolean
is.Object
is.Array
is.Function
is.Arguments
is.JSON
is.RegExp
is.DateES6
is.Symbol
is.Map
is.Set
is.Promise
is.GeneratorFunction
is.AsyncFunctionClient side check
is.Window
is.HTMLDivElement
is.NodeList
is.HTMLCollection
is.Location
is.DocumentFragmentTest
npm install
npm testSince async is supported since Node 7.x, update your Node before running test.
TODO
- is.Document
- is.Element