type-detail
v1.1.0
Published
A function check real typeof value in JavaScript
Downloads
5
Readme
Type
A function check real typeof value in JavaScript.
Installation
npm i type-detail
# or
yarn add type-detail
Usage
import typeDetail from 'type-detail';
// or import { typeDetail } from 'type-detail';
typeDetail(1); // 'integer'
typeDetail(1.1); // 'float'
typeDetail([1, 2, 3]); // 'array'
typeDetail(class Cat {}); // 'class'
typeDetail(async function () {}); // 'promise'
typeDetail(function* () {}); // 'generator'
Support
- integer
- float
- infinity
- NaN
- string
- boolean
- array
- object
- null
- undefined
- function
- symbol
- map
- set
- weakMap
- weakSet
- date
- regExp
- error
- promise
- arrayBuffer
- dataView
- int8Array
- uint8Array
- uint8ClampedArray
- int16Array
- uint16Array
- int32Array
- uint32Array
- float32Array
- float64Array
- BigInt64Array
- BigUint64Array
- generator