typeof-plus
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

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

Dependencies (0)

    Dev Dependencies (1)

    Package Sidebar

    Install

    npm i typeof-plus

    Weekly Downloads

    17

    Version

    1.0.5

    License

    ISC

    Unpacked Size

    3.99 kB

    Total Files

    7

    Last publish

    Collaborators

    • hymenhan