Check If Type is based on just. It provides helpers to check if argument type is object, array, function
npm i @rocketstation/check-if-type
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(() => {})) // true
We were tired of writing this code again and again
Check If Type is licensed under the MIT License
Created by RocketStation