1.0.5 • Published 3 years ago

typeof-plus v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

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