is-number-object
Is this value a JS Number object? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
Last updated 3 years ago by ljharb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install is-number-object 
SYNC missed versions from official npm registry.

is-number-object Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

Is this value a JS Number object? This module works cross-realm/iframe, and despite ES6 @@toStringTag.

Example

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)));

Tests

Simply clone the repo, npm install, and run npm test

Current Tags

  • 1.0.7                                ...           latest (3 years ago)

7 Versions

  • 1.0.7                                ...           3 years ago
  • 1.0.6                                ...           3 years ago
  • 1.0.5                                ...           4 years ago
  • 1.0.4                                ...           5 years ago
  • 1.0.3                                ...           10 years ago
  • 1.0.2                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (12)

Copyright 2013 - present © cnpmjs.org | Home |