Package Exports
- get-data-type
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 (get-data-type) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
get-data-type
Get data's type
how to use get-data-type
npm install --save data-typeconst dataType = require('get-data-type');
dataType('test'); // return 'string'test
const assert = require('assert');
const m = require('./');
assert(m(null) === 'null', 'should return null');
assert(m(undefined) === 'undefined', 'should return undefined');
assert(m(true) === 'boolean', 'should return boolean');
assert(m(false) === 'boolean', 'should return boolean');
assert(m(1) === 'number', 'should return number');
assert(m('test') === 'string', 'should return string');
assert(m(Symbol()) === 'symbol', 'should return symbol');
assert(m({}) === 'object', 'should return object');
assert(m([]) === 'array', 'should return array');
assert(m(()=>{}) === 'function', 'should return function');
assert(m(new Date()) === 'date', 'should return date');
assert(m(new RegExp()) === 'regexp', 'should return regexp');