@maksims/is.js
v1.0.1
Published
Simple utility library with variable type checking functions.
Readme
is.js
Simple utility library with variable type checking functions.
Documentation
The usage is quite simple and obviously, import the function which you need, call the function and do you stuff
import { isString } from "@maksims/is.js";
// do stuffBut there are two functions that may need some explanation, first function is isObject checks is passed
value a any valid javascript object exclude null and Array, for example
import { isObject } from "@maksims/is.js";
isObject({}) // true
isObject({
PI: 3.14,
sum: (a, b) => a + b
}) // true
isObject(new Map()) // true
isObject(20) // false
isObject([]) // falseSecond function isRecord function checks is passed value a plain javascript object, for example
import { isObject } from "@maksims/is.js";
isRecord({}) // true
isRecord({
PI: 3.14,
sum: (a, b) => a + b
}) // true
isRecord(new Map()) // false
isRecord(20) // false
isRecord([]) // false