1 | "use strict";
|
2 | var each = require("../collection/each");
|
3 | var typeObj = {};
|
4 | each(['Arguments', 'Function', 'String', 'Date', 'RegExp', 'Error', 'Symbol', 'Map', 'WeakMap', 'Set', 'WeakSet'], function (name) {
|
5 | typeObj["is" + name] = function (obj) {
|
6 | return Object.prototype.toString.call(obj) === "[object " + name + "]";
|
7 | };
|
8 | });
|
9 | typeObj.isNumber = function (obj) {
|
10 | return Object.prototype.toString.call(obj) === '[object Number]' && !isNaN(obj);
|
11 | };
|
12 | typeObj.isArray = function (value) {
|
13 | return Array.isArray(value);
|
14 | };
|
15 | module.exports = typeObj;
|
16 |
|
\ | No newline at end of file |