@rocketstation/check-if-type
v2.0.0
Published
provides helpers to check if argument type is object, array, function
Readme
Check If Type
Check If Type is based on just. It provides helpers to check if argument type is object, array, function
Installation
npm i @rocketstation/check-if-typeUsage
import * as checkIfType from '@rocketstation/check-if-type'
console.log(checkIfType.isObj({})) // true
console.log(checkIfType.isObj([])) // false
console.log(checkIfType.isObj(() => {})) // false
console.log(checkIfType.isArr({})) // false
console.log(checkIfType.isArr([])) // true
console.log(checkIfType.isArr(() => {})) // false
console.log(checkIfType.isFn({})) // false
console.log(checkIfType.isFn([])) // false
console.log(checkIfType.isFn(() => {})) // trueMotivation
We were tired of writing this code again and again
License
Check If Type is licensed under the MIT License
Created by RocketStation
