README
check-fn
What is dis?
A list of bool functions that checks for type of a JS variable .
This uses the strict equality operator (===) while checking.
Content
Installation
npm i check-fn --save
Important
Add this line at your top of the javascript file and import any function you want.
import {
checkNum,
checkBigInt,
checkStr,
checkBool,
checkSym,
checkUnd,
checkObj,
checkFn
} from 'check-fn';
Usage
Make use of the following functions in your code.
checkNum
checkNum(42);
// true
checkBigInt
checkBigInt(42n);
// true
checkStr
checkStr("foo");
// true
checkBool
checkBool(true);
// true
checkSym
checkSym(Symbol());
// true
checkUnd
let bar;
checkUnd(bar);
// true
checkObj
checkObj({"rainbow": "🌈"});
// true
checkFn
const bazz = () => { console.log("🦄") }
checkFn(bazz);
// true
Congratulations You Can make your Code even shorter than before.
LICENSE
MIT License