typeof-plus
v1.0.5
Published
typeof-plus is a small tool to judge the data type of variables
Downloads
88
Maintainers
Readme
typeof-plus - a small tool to judge the data type of variables
Install
npm install typeof-plus
Usage
import { typeis } from "typeof-plus";
typeis(null); // null
typeis([1, 2, 3]); // array
typeis({ name: "test" }); // object
typeis(/abc/g); // regexp
typeis(new Date()); // date
typeis(123n); // bigint
typeis(123); // number
typeis(undefined); // undefined
typeis("hello"); // string
typeis(true); // boolean
typeis(Symbol("test")); // symbol
typeis(() => {}); // function