Bakhtina Sofya b84cb877be 1st comm | 3 settimane fa | |
---|---|---|
.. | ||
.github | 3 settimane fa | |
test | 3 settimane fa | |
.editorconfig | 3 settimane fa | |
.eslintrc | 3 settimane fa | |
.nycrc | 3 settimane fa | |
CHANGELOG.md | 3 settimane fa | |
LICENSE | 3 settimane fa | |
README.md | 3 settimane fa | |
index.js | 3 settimane fa | |
package.json | 3 settimane fa |
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