Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

@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).

install

npm i @yokotak0527/js-type-is

Downloadsweekly downloads

2

version

0.1.4

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability