liup a01a5aa773 | pirms 3 nedēļām | |
---|---|---|
.. | ||
.github | pirms 3 nedēļām | |
test | pirms 3 nedēļām | |
.editorconfig | pirms 3 nedēļām | |
.eslintrc | pirms 3 nedēļām | |
.nycrc | pirms 3 nedēļām | |
CHANGELOG.md | pirms 3 nedēļām | |
LICENSE | pirms 3 nedēļām | |
README.md | pirms 3 nedēļām | |
index.d.ts | pirms 3 nedēļām | |
index.js | pirms 3 nedēļām | |
package.json | pirms 3 nedēļām | |
tsconfig.json | pirms 3 nedēļām |
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