@yokotak0527/js-type-is

0.1.4 • Public • Published

js-type-is

If you want to check type of value on the browser, this library may be useful.

Install

$ npm install @yokotak0527/js-type-is

Usage

import typeis from '@yokotak0527/js-type-is'
typeis('hello') // String

when using CommonJS

const typeis = require('@yokotak0527/js-type-is')
typeis(1) // Number

Suppoert types

  • String
  • Number
  • Undefined
  • Function
  • Object
  • Symbol
  • Boolean
  • Null
  • RegExp
  • Error
  • EvalError
  • RangeError
  • ReferenceError
  • SyntaxError
  • TypeError
  • URIError
  • Math
  • Date
  • Array
  • Int8Array
  • Uint8Array
  • Uint8ClampedArray
  • Int16Array
  • Uint16Array
  • Int32Array
  • Uint32Array
  • Float32Array
  • Float64Array
  • Map
  • Set
  • WeakMap
  • WeakSet
  • ArrayBuffer
  • DataView
  • JSON
  • Promise

And your defined types(class).

Readme

Keywords

Package Sidebar

Install

npm i @yokotak0527/js-type-is

Weekly Downloads

0

Version

0.1.4

License

MIT

Unpacked Size

20.9 kB

Total Files

14

Last publish

Collaborators

  • yokotak0527