Package Exports
- typeov
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (typeov) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
typeov 
Install (~1900 bytes)
npm install --save typeov
yarn add typeovUsage
import { typeov } from 'typeov'
const a = []
if (typeov(a) === 'array') {
// true => array
}
if (typeof(a) === 'array') {
// false => object
}var typeov = require('typeov').typeov
var b = Math.PI
if (typeov(b) === 'float') {
// true
}const jsonString = '[{"version":"1.2.3"}]'
const isJSON = typeov(jsonString) === 'json' // truePossible return values
- array
- boolean
- buffer
- float
- function
- infinity
- json
- map
- null
- number
- object
- promise
- regexp
- set
- stream
- symbol
- undefined
- weakmap
- weakset
Notes
Be mindful of what you're checking
> typeov(Symbol)
'function'
> typeov(Symbol())
'symbol'> typeov(Promise)
'function'
> typeov(new Promise(() => {}))
'promise'
> typeov(Promise.resolve(true))
'promise'