Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

is-number-object

inspect-js161.2mMIT1.1.1TypeScript support: included

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

Number, ES6, toStringTag, @@toStringTag, Number object

readme

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

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

v1.1.1 - 2024-12-15

Commits

  • [Dev Deps] update @arethetypeswrong/cli,@ljharb/tsconfig, @types/tape 00d566d
  • [Refactor] use call-bound directly 073d5df
  • [Deps] update call-bind 36c84af

v1.1.0 - 2024-12-01

Commits

  • [meta] use npmignore to autogenerate an npmignore file cb8423c
  • [New] add types 273e406
  • [actions] split out node 10-20, and 20+ 3da6267
  • [Robustness] use call-bind 834c098
  • [actions] update rebase action to use reusable workflow 84a8a9f
  • [Dev Deps] update @ljharb/eslint-config, auto-changelog, core-js, npmignore, tape 7275bca
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, core-js, tape 49a83aa
  • [Tests] replace aud with npm audit 061492b
  • [Refactor] avoid an expensive check, for null 08d29a8
  • [Deps] update has-tostringtag 4e2ad65
  • [Dev Deps] add missing peer dep 8228bfa

v1.0.7 - 2022-04-01

Commits

  • [actions] reuse common workflows 8f9a1b0
  • [meta] better eccheck command 9dc8dff
  • [Dev Deps] update eslint, @ljharb/eslint-config, core-js, safe-publish-latest, tape c50ecbf
  • [actions] update codecov uploader f1a2560
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, core-js, tape 4b06ace
  • [Dev Deps] update eslint, @ljharb/eslint-config, auto-changelog, core-js, tape 3dc0e8b
  • [meta] add bugs/homepage package.json fields d7e0bcf

v1.0.6 - 2021-08-05

Commits

  • [Tests] run tests with core-js as well 5177312
  • [Refactor] use has-tostringtag to behave correctly in the presence of symbol shams ca2b31d
  • [Dev Deps] update auto-changelog, core-js, eslint, tape 50950f9

v1.0.5 - 2021-05-07

Commits

  • [Tests] migrate tests to Github Actions 9666737
  • [actions] use node/install instead of node/run; use codecov action 7815ce2
  • [meta] do not publish github action workflow files 80ccb75
  • [Tests] run nyc on all tests c9ffb74
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, auto-changelog, tape 7e84161
  • [readme] add actions and codecov badges 0c5ec7a
  • [actions] add Require Allow Edits workflow dd0fb74
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, has-symbols, tape 2d36f80
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, auto-changelog 77d3140
  • [Dev Deps] update eslint, @ljharb/eslint-config, tape 75d4abf
  • [Dev Deps] update eslint, @ljharb/eslint-config, tape 0c2a917
  • [Fix] do not use Object.prototype.toString when Symbol.toStringTag is shammed 8b6ebc4
  • [Dev Deps] update auto-changelog, tape; add aud 62045fc
  • [actions] use checkout v2; remove unneeded env d48cd06
  • [meta] use prepublishOnly script for npm 7+ 827ab0d
  • [actions] switch Automatic Rebase workflow to pull_request_target event bfed500
  • [meta] remove explicit audit level config ce23e5e
  • [meta] gitignore coverage output f1ad981

v1.0.4 - 2019-12-18

Commits

  • [Tests] use shared travis-ci configs 792b5aa
  • [Tests] up to node v12.4, v11.15, v10.15, v9.11, v8.15, v7.10, v6.17, v5.12, v4.9; use nvm install-latest-npm dc66db7
  • Update eslint, tape, semver; use my personal shared eslint config 7660fed
  • [Tests] remove jscs f1fee97
  • [meta] add auto-changelog 4b1c225
  • [meta] remove unused Makefile and associated utilities 379b979
  • Update covert, jscs, eslint, semver 16d2af8
  • [Dev Deps] update eslint, @ljharb/eslint-config, covert, is, replace, semver, tape 21c0f04
  • Update is, tape, covert, jscs, editorconfig-tools, nsp, eslint, semver. Add replace. Use ^ instead of ~. 19d6ee3
  • Update eslint d32754b
  • [Dev Deps] update eslint, @ljharb/eslint-config, replace 1df8165
  • Update tape, jscs, eslint, @ljharb/eslint-config 675372b
  • [readme] clean up readme; remove testling; fix repo URLs 80e29c4
  • [Tests] up to node v12.7, v10.16, v8.16 287a968
  • Test on latest iojs and node versions. 11c98a2
  • [actions] add automatic rebasing / merge commit blocking 022d026
  • [meta] create FUNDING.yml 7f52710
  • [Dev Deps] update is, jscs, nsp, eslint, @ljharb/eslint-config, semver bc8cd50
  • [Tests] use npx aud instead of nsp or npm audit with hoops 1f9200b
  • [Tests] up to node v12.11 706d50a
  • [Dev Deps] update jscs e3591a4
  • [Tests] up to io.js v3.3, node v4.1 baf4ee7
  • Update nsp, eslint 61b18d5
  • Update eslint, semver 52e61bd
  • [Dev Deps] update eslint, @ljharb/eslint-config, has-symbols; add safe-publish-latest 79db7f6
  • Only apps should have lockfiles 677b9b4
  • Test on io.js v2.2 e8a38b2
  • [meta] add funding field 85315e7
  • [Dev Deps] update eslint, tape f3581aa
  • [Tests] use eclint instead of editorconfig-tools 7b53680
  • [Dev Deps] update semver, tape d6b524a
  • [Dev Deps] Update tape, eslint be19203
  • Test up to io.js v2.1 feb7ba6
  • Test up to io.js v3.0 7be1f0a
  • [Dev Deps] update tape d9a2318
  • Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG. a6cd411
  • Test on io.js v2.4 46c2e7f
  • Test on io.js v2.3 9c344b0
  • Fix tests for faked @@toStringTag f8c446e

v1.0.3 - 2015-01-29

Commits

  • If @@toStringTag is not present, use the old-school Object#toString test. 9b2a4df

v1.0.2 - 2015-01-29

Commits

  • Improve optimizability of the non-try/catch part. 7e6be2f
  • Fix package.json 4f2ebea

v1.0.1 - 2015-01-29

Commits

  • Use Object() instead of new Number() 1aaa746
  • Add early exits for typeof number, or typeof not "object". eae4337

v1.0.0 - 2015-01-28

Commits