inspect-js/is-number-object


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

License: MIT

Language: Makefile


is-number-object Version Badge

Build Status dependency status dev dependency status License Downloads

npm badge

browser support

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

Project Statistics

Sourcerank 10
Repository Size 40 KB
Stars 6
Forks 1
Watchers 2
Open issues 2
Dependencies 11
Contributors 1
Tags 4
Created
Last updated
Last pushed

Top Contributors See all

Jordan Harband

Packages Referencing this Repo

is-number-object
Is this value a JS Number object? This module works cross-realm/iframe, and despite ES6 @@toStrin...
Latest release 1.0.3 - Updated - 6 stars
org.webjars.npm:is-number-object
WebJar for is-number-object
Latest release 1.0.3 - Published - 6 stars

Recent Tags See all

v1.0.3 January 30, 2015
v1.0.2 January 29, 2015
v1.0.1 January 29, 2015
v1.0.0 January 28, 2015

Something wrong with this page? Make a suggestion

Last synced: 2019-08-10 17:14:12 UTC

Login to resync this repository