Skip to content

provides helpers to check if argument type is object, array, function

Notifications You must be signed in to change notification settings

rocketstation/check-if-type

Repository files navigation

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-type

Usage

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

Motivation

We were tired of writing this code again and again

License

Check If Type is licensed under the MIT License

Created by RocketStation

About

provides helpers to check if argument type is object, array, function

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published