caoge c760052ff9 机车状态修改 | 8 月之前 | |
---|---|---|
.. | ||
.github | 8 月之前 | |
test | 8 月之前 | |
.editorconfig | 8 月之前 | |
.eslintrc | 8 月之前 | |
.nycrc | 8 月之前 | |
CHANGELOG.md | 8 月之前 | |
LICENSE | 8 月之前 | |
README.md | 8 月之前 | |
index.js | 8 月之前 | |
package.json | 8 月之前 |
Is this value a JS Number object? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
var isNumber = require('is-number-object');
var assert = require('assert');
assert.notOk(isNumber(undefined));
assert.notOk(isNumber(null));
assert.notOk(isNumber(false));
assert.notOk(isNumber(true));
assert.notOk(isNumber('foo'));
assert.notOk(isNumber(function () {}));
assert.notOk(isNumber([]));
assert.notOk(isNumber({}));
assert.notOk(isNumber(/a/g));
assert.notOk(isNumber(new RegExp('a', 'g')));
assert.notOk(isNumber(new Date()));
assert.ok(isNumber(42));
assert.ok(isNumber(NaN));
assert.ok(isNumber(Infinity));
assert.ok(isNumber(new Number(42)));
Simply clone the repo, npm install
, and run npm test