pax_global_header00006660000000000000000000000064142217525060014516gustar00rootroot0000000000000052 comment=50c53ae827537cd9d951c87e9e6286339575d402 is-number-object-1.0.7/000077500000000000000000000000001422175250600146705ustar00rootroot00000000000000is-number-object-1.0.7/.editorconfig000066400000000000000000000005041422175250600173440ustar00rootroot00000000000000root = true [*] indent_style = tab indent_size = 4 end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true max_line_length = 150 [CHANGELOG.md] indent_style = space indent_size = 2 [*.json] max_line_length = off [Makefile] max_line_length = off [CHANGELOG.md] max_line_length = off is-number-object-1.0.7/.eslintrc000066400000000000000000000003011422175250600165060ustar00rootroot00000000000000{ "root": true, "extends": "@ljharb", "rules": { "func-name-matching": 0, }, "overrides": [ { "files": "test-core-js.js", "extends": "@ljharb/eslint-config/tests", }, ], } is-number-object-1.0.7/.github/000077500000000000000000000000001422175250600162305ustar00rootroot00000000000000is-number-object-1.0.7/.github/FUNDING.yml000066400000000000000000000011131422175250600200410ustar00rootroot00000000000000# These are supported funding model platforms github: [ljharb] patreon: # Replace with a single Patreon username open_collective: # Replace with a single Open Collective username ko_fi: # Replace with a single Ko-fi username tidelift: npm/is-number-object community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry liberapay: # Replace with a single Liberapay username issuehunt: # Replace with a single IssueHunt username otechie: # Replace with a single Otechie username custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] is-number-object-1.0.7/.github/workflows/000077500000000000000000000000001422175250600202655ustar00rootroot00000000000000is-number-object-1.0.7/.github/workflows/node-aught.yml000066400000000000000000000005161422175250600230450ustar00rootroot00000000000000name: 'Tests: node.js < 10' on: [pull_request, push] jobs: tests: uses: ljharb/actions/.github/workflows/node.yml@main with: range: '< 10' type: minors command: npm run tests-only node: name: 'node < 10' needs: [tests] runs-on: ubuntu-latest steps: - run: 'echo tests completed' is-number-object-1.0.7/.github/workflows/node-pretest.yml000066400000000000000000000002061422175250600234170ustar00rootroot00000000000000name: 'Tests: pretest/posttest' on: [pull_request, push] jobs: tests: uses: ljharb/actions/.github/workflows/pretest.yml@main is-number-object-1.0.7/.github/workflows/node-tens.yml000066400000000000000000000005211422175250600227020ustar00rootroot00000000000000name: 'Tests: node.js >= 10' on: [pull_request, push] jobs: tests: uses: ljharb/actions/.github/workflows/node.yml@main with: range: '>= 10' type: minors command: npm run tests-only node: name: 'node >= 10' needs: [tests] runs-on: ubuntu-latest steps: - run: 'echo tests completed' is-number-object-1.0.7/.github/workflows/rebase.yml000066400000000000000000000004111422175250600222450ustar00rootroot00000000000000name: Automatic Rebase on: [pull_request_target] jobs: _: name: "Automatic Rebase" runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: ljharb/rebase@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} is-number-object-1.0.7/.github/workflows/require-allow-edits.yml000066400000000000000000000003031422175250600247020ustar00rootroot00000000000000name: Require “Allow Edits” on: [pull_request_target] jobs: _: name: "Require “Allow Edits”" runs-on: ubuntu-latest steps: - uses: ljharb/require-allow-edits@main is-number-object-1.0.7/.gitignore000066400000000000000000000012531422175250600166610ustar00rootroot00000000000000# Logs logs *.log # Runtime data pids *.pid *.seed # Directory for instrumented libs generated by jscoverage/JSCover lib-cov # Coverage directory used by tools like istanbul coverage .nyc_output/ # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) .grunt # Compiled binary addons (http://nodejs.org/api/addons.html) build/Release # Dependency directory # Commenting this out is preferred by some people, see # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- node_modules # Users Environment Variables .lock-wscript # Only apps should have lockfiles npm-shrinkwrap.json package-lock.json yarn.lock is-number-object-1.0.7/.npmignore000066400000000000000000000013161422175250600166700ustar00rootroot00000000000000# Logs logs *.log # Runtime data pids *.pid *.seed # Directory for instrumented libs generated by jscoverage/JSCover lib-cov # Coverage directory used by tools like istanbul coverage .nyc_output/ # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) .grunt # Compiled binary addons (http://nodejs.org/api/addons.html) build/Release # Dependency directory # Commenting this out is preferred by some people, see # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- node_modules # Users Environment Variables .lock-wscript # Only apps should have lockfiles npm-shrinkwrap.json package-lock.json yarn.lock .github/workflows test-corejs.js is-number-object-1.0.7/.npmrc000066400000000000000000000000671422175250600160130ustar00rootroot00000000000000package-lock=false allow-same-version=true message=v%s is-number-object-1.0.7/.nycrc000066400000000000000000000002371422175250600160110ustar00rootroot00000000000000{ "all": true, "check-coverage": false, "reporter": ["text-summary", "text", "html", "json"], "exclude": [ "coverage", "test", "test-corejs.js" ] } is-number-object-1.0.7/CHANGELOG.md000066400000000000000000000323521422175250600165060ustar00rootroot00000000000000# Changelog All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [v1.0.7](https://github.com/inspect-js/is-number-object/compare/v1.0.6...v1.0.7) - 2022-04-01 ### Commits - [actions] reuse common workflows [`8f9a1b0`](https://github.com/inspect-js/is-number-object/commit/8f9a1b040a435a5c5d12150952d0e6f96d4f713a) - [meta] better `eccheck` command [`9dc8dff`](https://github.com/inspect-js/is-number-object/commit/9dc8dff273e4d0b954fd4f2a2eacc849d321b646) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `core-js`, `safe-publish-latest`, `tape` [`c50ecbf`](https://github.com/inspect-js/is-number-object/commit/c50ecbfc7577c69324fca4d2b40dd354c5156be9) - [actions] update codecov uploader [`f1a2560`](https://github.com/inspect-js/is-number-object/commit/f1a2560d4a996abea90f7a792069a35359869b67) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `core-js`, `tape` [`4b06ace`](https://github.com/inspect-js/is-number-object/commit/4b06aceeba2ebf0887af020aa89caad8950e5f47) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `auto-changelog`, `core-js`, `tape` [`3dc0e8b`](https://github.com/inspect-js/is-number-object/commit/3dc0e8b0fcc96a9bc9936e9a62a523fe67bafca5) - [meta] add `bugs`/`homepage` package.json fields [`d7e0bcf`](https://github.com/inspect-js/is-number-object/commit/d7e0bcf1fe1b4a48d6500266c8b4058c854fecba) ## [v1.0.6](https://github.com/inspect-js/is-number-object/compare/v1.0.5...v1.0.6) - 2021-08-05 ### Commits - [Tests] run tests with core-js as well [`5177312`](https://github.com/inspect-js/is-number-object/commit/51773120b18e27bfe8a3bd228ef2e21f5802f338) - [Refactor] use `has-tostringtag` to behave correctly in the presence of symbol shams [`ca2b31d`](https://github.com/inspect-js/is-number-object/commit/ca2b31d81c5d7d9b11e812dee58cd627a6d634e2) - [Dev Deps] update `auto-changelog`, `core-js`, `eslint`, `tape` [`50950f9`](https://github.com/inspect-js/is-number-object/commit/50950f962a4b1188c478f6034194d7eb4314c884) ## [v1.0.5](https://github.com/inspect-js/is-number-object/compare/v1.0.4...v1.0.5) - 2021-05-07 ### Commits - [Tests] migrate tests to Github Actions [`9666737`](https://github.com/inspect-js/is-number-object/commit/96667372f8e36f70516218f86318f957f8c175ad) - [actions] use `node/install` instead of `node/run`; use `codecov` action [`7815ce2`](https://github.com/inspect-js/is-number-object/commit/7815ce21cb5662c2d1651b3ec302f186aa8a016b) - [meta] do not publish github action workflow files [`80ccb75`](https://github.com/inspect-js/is-number-object/commit/80ccb7509f91732675b018cc1a636d649a92889e) - [Tests] run `nyc` on all tests [`c9ffb74`](https://github.com/inspect-js/is-number-object/commit/c9ffb74443690ef22f9aa7dd35855fd1e3be5184) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`7e84161`](https://github.com/inspect-js/is-number-object/commit/7e84161d089c87ef42e3639ac1889642624ebd28) - [readme] add actions and codecov badges [`0c5ec7a`](https://github.com/inspect-js/is-number-object/commit/0c5ec7aa87dac27bdcda2365124c3aa0ccf9c278) - [actions] add Require Allow Edits workflow [`dd0fb74`](https://github.com/inspect-js/is-number-object/commit/dd0fb74b2ecb630ea7778a6f06dcc017323a3c1d) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `has-symbols`, `tape` [`2d36f80`](https://github.com/inspect-js/is-number-object/commit/2d36f809a7b9896958b0b0f3b69be0067caedb45) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog` [`77d3140`](https://github.com/inspect-js/is-number-object/commit/77d3140557d483e467ce070b21bf384e9a7562d5) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`75d4abf`](https://github.com/inspect-js/is-number-object/commit/75d4abf34168e69d73f621c696a16179ddc0873c) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`0c2a917`](https://github.com/inspect-js/is-number-object/commit/0c2a917e4802b102888759fad912bd9faa5587f7) - [Fix] do not use `Object.prototype.toString` when `Symbol.toStringTag` is shammed [`8b6ebc4`](https://github.com/inspect-js/is-number-object/commit/8b6ebc489db14a0c369214e081413f326fc0d598) - [Dev Deps] update `auto-changelog`, `tape`; add `aud` [`62045fc`](https://github.com/inspect-js/is-number-object/commit/62045fcaddb9e4d3ef81068e99d07d21cd62023b) - [actions] use checkout v2; remove unneeded env [`d48cd06`](https://github.com/inspect-js/is-number-object/commit/d48cd06720ea71f278a6d35c6f0a8ec04242a58f) - [meta] use `prepublishOnly` script for npm 7+ [`827ab0d`](https://github.com/inspect-js/is-number-object/commit/827ab0d52d25f46d232ae7442ece270dec2de1df) - [actions] switch Automatic Rebase workflow to `pull_request_target` event [`bfed500`](https://github.com/inspect-js/is-number-object/commit/bfed500e6cc3cd3b9e7ffea78429c59857035791) - [meta] remove explicit audit level config [`ce23e5e`](https://github.com/inspect-js/is-number-object/commit/ce23e5e49fbebe190267d8c99ddfd880a963b7ee) - [meta] gitignore coverage output [`f1ad981`](https://github.com/inspect-js/is-number-object/commit/f1ad98106549c1c88322d8cb206068ea4c5bd424) ## [v1.0.4](https://github.com/inspect-js/is-number-object/compare/v1.0.3...v1.0.4) - 2019-12-18 ### Commits - [Tests] use shared travis-ci configs [`792b5aa`](https://github.com/inspect-js/is-number-object/commit/792b5aa5e7313ddf5507f7283bb7d5d5c646b11b) - [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`](https://github.com/inspect-js/is-number-object/commit/dc66db7dd1eca0263f6602597eb40601519e912e) - Update `eslint`, `tape`, `semver`; use my personal shared `eslint` config [`7660fed`](https://github.com/inspect-js/is-number-object/commit/7660fed03a7060eb5c91e74b9a17303d4fac1056) - [Tests] remove `jscs` [`f1fee97`](https://github.com/inspect-js/is-number-object/commit/f1fee97423478bcc653c844fadda55138d9b9a54) - [meta] add `auto-changelog` [`4b1c225`](https://github.com/inspect-js/is-number-object/commit/4b1c2253770eb18761a1e8b157772028d6f742c4) - [meta] remove unused Makefile and associated utilities [`379b979`](https://github.com/inspect-js/is-number-object/commit/379b9793d9c61d7889e53bd9de9578dca9964ebc) - Update `covert`, `jscs`, `eslint`, `semver` [`16d2af8`](https://github.com/inspect-js/is-number-object/commit/16d2af82a6c93aee614f7a4b2c468411c743e95f) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `covert`, `is`, `replace`, `semver`, `tape` [`21c0f04`](https://github.com/inspect-js/is-number-object/commit/21c0f0431984b87443c6acb9f003368feb7b4368) - Update `is`, `tape`, `covert`, `jscs`, `editorconfig-tools`, `nsp`, `eslint`, `semver`. Add `replace`. Use `^` instead of `~`. [`19d6ee3`](https://github.com/inspect-js/is-number-object/commit/19d6ee3a3d4a87764d57316804fd8b882ba5197c) - Update `eslint` [`d32754b`](https://github.com/inspect-js/is-number-object/commit/d32754bcca0033e01eba531c4353d1239e992203) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `replace` [`1df8165`](https://github.com/inspect-js/is-number-object/commit/1df8165dd63d9f2f78ccb78e905d0a6b3e302884) - Update `tape`, `jscs`, `eslint`, `@ljharb/eslint-config` [`675372b`](https://github.com/inspect-js/is-number-object/commit/675372b115fb20b5034f40bcbb5560c6c0512746) - [readme] clean up readme; remove testling; fix repo URLs [`80e29c4`](https://github.com/inspect-js/is-number-object/commit/80e29c4d6d0811fc361e95ee83b81280bf3ae3f5) - [Tests] up to `node` `v12.7`, `v10.16`, `v8.16` [`287a968`](https://github.com/inspect-js/is-number-object/commit/287a9687b1fc3d091ec231c06f19a19ff7b0e8f6) - Test on latest `iojs` and `node` versions. [`11c98a2`](https://github.com/inspect-js/is-number-object/commit/11c98a23b232cb21c7daab797fd63875c2970681) - [actions] add automatic rebasing / merge commit blocking [`022d026`](https://github.com/inspect-js/is-number-object/commit/022d026129df445f239ba2ecd8d47a2786242d75) - [meta] create FUNDING.yml [`7f52710`](https://github.com/inspect-js/is-number-object/commit/7f527107168aad7108b7c262d295dcf44e03214d) - [Dev Deps] update `is`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver` [`bc8cd50`](https://github.com/inspect-js/is-number-object/commit/bc8cd508fe4440168f9b049be3ddf93c56c06c49) - [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops [`1f9200b`](https://github.com/inspect-js/is-number-object/commit/1f9200b7c56840dc23eeeca5d0ee4f64a0446e08) - [Tests] up to `node` `v12.11` [`706d50a`](https://github.com/inspect-js/is-number-object/commit/706d50a779b90feb3f4d2ae88d8189d19b913073) - [Dev Deps] update `jscs` [`e3591a4`](https://github.com/inspect-js/is-number-object/commit/e3591a445b1af25d46632eafea51efa07b4eb6dc) - [Tests] up to `io.js` `v3.3`, `node` `v4.1` [`baf4ee7`](https://github.com/inspect-js/is-number-object/commit/baf4ee749fb65ec12e9cab102e77aa0e14312109) - Update `nsp`, `eslint` [`61b18d5`](https://github.com/inspect-js/is-number-object/commit/61b18d5b44542fddf4950534d506b20d8c8b1f44) - Update `eslint`, `semver` [`52e61bd`](https://github.com/inspect-js/is-number-object/commit/52e61bd4334c0a1afacd147fd0bc1e2c1be10df5) - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `has-symbols`; add `safe-publish-latest` [`79db7f6`](https://github.com/inspect-js/is-number-object/commit/79db7f610d2bcf5f0d6e8ca834f7402504101072) - Only apps should have lockfiles [`677b9b4`](https://github.com/inspect-js/is-number-object/commit/677b9b4fb6ad9d7b984cb0f89c8b5a6df143b29a) - Test on `io.js` `v2.2` [`e8a38b2`](https://github.com/inspect-js/is-number-object/commit/e8a38b2fe73b841b0ed55d9f60573d460a4f2a62) - [meta] add `funding` field [`85315e7`](https://github.com/inspect-js/is-number-object/commit/85315e75c119a2aef70a766f2ddc1079b64d006b) - [Dev Deps] update `eslint`, `tape` [`f3581aa`](https://github.com/inspect-js/is-number-object/commit/f3581aaea310546f6ee4612990468d39f058d320) - [Tests] use `eclint` instead of `editorconfig-tools` [`7b53680`](https://github.com/inspect-js/is-number-object/commit/7b5368071000eb1c715aeeee5ff47ffdbee9fe5c) - [Dev Deps] update `semver`, `tape` [`d6b524a`](https://github.com/inspect-js/is-number-object/commit/d6b524ac2e8c0240c436cbe8828671e383d51fd5) - [Dev Deps] Update `tape`, `eslint` [`be19203`](https://github.com/inspect-js/is-number-object/commit/be19203dee0aa70ff8f09823bf880a38b824e1ed) - Test up to `io.js` `v2.1` [`feb7ba6`](https://github.com/inspect-js/is-number-object/commit/feb7ba63a0816f1d36419ce240f96e9b4e4c90ba) - Test up to `io.js` `v3.0` [`7be1f0a`](https://github.com/inspect-js/is-number-object/commit/7be1f0a25dc59b6606be9ee1ace38cb7039a59d2) - [Dev Deps] update `tape` [`d9a2318`](https://github.com/inspect-js/is-number-object/commit/d9a2318bc82477e9321e961def11e28d364e5562) - Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG. [`a6cd411`](https://github.com/inspect-js/is-number-object/commit/a6cd411c6bd92691a48b52683afce584c2c6b21b) - Test on `io.js` `v2.4` [`46c2e7f`](https://github.com/inspect-js/is-number-object/commit/46c2e7f2ce8ad7f8ab3c1da827d93fc2780eff06) - Test on `io.js` `v2.3` [`9c344b0`](https://github.com/inspect-js/is-number-object/commit/9c344b0df83628908a1f776a3f2e5fc4fae1d4d2) - Fix tests for faked @@toStringTag [`f8c446e`](https://github.com/inspect-js/is-number-object/commit/f8c446e9fc320c23807717356e259529f494b9f3) ## [v1.0.3](https://github.com/inspect-js/is-number-object/compare/v1.0.2...v1.0.3) - 2015-01-29 ### Commits - If @@toStringTag is not present, use the old-school Object#toString test. [`9b2a4df`](https://github.com/inspect-js/is-number-object/commit/9b2a4df6ccf903e89198d4244eeb7f47a7056327) ## [v1.0.2](https://github.com/inspect-js/is-number-object/compare/v1.0.1...v1.0.2) - 2015-01-29 ### Commits - Improve optimizability of the non-try/catch part. [`7e6be2f`](https://github.com/inspect-js/is-number-object/commit/7e6be2fd2346557fc81bd544ac8745021c50e266) - Fix package.json [`4f2ebea`](https://github.com/inspect-js/is-number-object/commit/4f2ebeae09c45e1eefeb2c10a011ff2ef0aca921) ## [v1.0.1](https://github.com/inspect-js/is-number-object/compare/v1.0.0...v1.0.1) - 2015-01-29 ### Commits - Use Object() instead of new Number() [`1aaa746`](https://github.com/inspect-js/is-number-object/commit/1aaa746c26878a0f698aabea4d88215311f2a38d) - Add early exits for typeof number, or typeof not "object". [`eae4337`](https://github.com/inspect-js/is-number-object/commit/eae43375d3f88e04bb10eabd954e5a6b66ad5305) ## v1.0.0 - 2015-01-28 ### Commits - Dotfiles. [`9c74e3e`](https://github.com/inspect-js/is-number-object/commit/9c74e3eb2b10398d4022de7c4015531e874f06c8) - `make release` [`a99e5ae`](https://github.com/inspect-js/is-number-object/commit/a99e5aeb3995a7d543fc5833722bc02011fabad6) - package.json [`4fed9ef`](https://github.com/inspect-js/is-number-object/commit/4fed9ef7c35ccfc45ca8acd3c92c9cb91c7daa6d) - Read me [`c91d6ba`](https://github.com/inspect-js/is-number-object/commit/c91d6ba00de79eaaac5fec7c9d8866d61d0abb62) - Initial commit [`629fb96`](https://github.com/inspect-js/is-number-object/commit/629fb969f076e0802c799b368c7b02556bb0750e) - Tests. [`a39de62`](https://github.com/inspect-js/is-number-object/commit/a39de624785cc204ed7c0ea5518f1c878870ceb1) - Implementation. [`aedd91e`](https://github.com/inspect-js/is-number-object/commit/aedd91e6fc23f00852ad1266b6c19f32b7f93a22) is-number-object-1.0.7/LICENSE000066400000000000000000000020721422175250600156760ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) 2015 Jordan Harband Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. is-number-object-1.0.7/README.md000066400000000000000000000041061422175250600161500ustar00rootroot00000000000000# is-number-object [![Version Badge][2]][1] [![github actions][actions-image]][actions-url] [![coverage][codecov-image]][codecov-url] [![dependency status][5]][6] [![dev dependency status][7]][8] [![License][license-image]][license-url] [![Downloads][downloads-image]][downloads-url] [![npm badge][11]][1] Is this value a JS Number object? This module works cross-realm/iframe, and despite ES6 @@toStringTag. ## Example ```js 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` [1]: https://npmjs.org/package/is-number-object [2]: https://versionbadg.es/inspect-js/is-number-object.svg [5]: https://david-dm.org/inspect-js/is-number-object.svg [6]: https://david-dm.org/inspect-js/is-number-object [7]: https://david-dm.org/inspect-js/is-number-object/dev-status.svg [8]: https://david-dm.org/inspect-js/is-number-object#info=devDependencies [11]: https://nodei.co/npm/is-number-object.png?downloads=true&stars=true [license-image]: https://img.shields.io/npm/l/is-number-object.svg [license-url]: LICENSE [downloads-image]: https://img.shields.io/npm/dm/is-number-object.svg [downloads-url]: https://npm-stat.com/charts.html?package=is-number-object [codecov-image]: https://codecov.io/gh/inspect-js/is-number-object/branch/main/graphs/badge.svg [codecov-url]: https://app.codecov.io/gh/inspect-js/is-number-object/ [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/is-number-object [actions-url]: https://github.com/inspect-js/is-number-object/actions is-number-object-1.0.7/index.js000066400000000000000000000010671422175250600163410ustar00rootroot00000000000000'use strict'; var numToStr = Number.prototype.toString; var tryNumberObject = function tryNumberObject(value) { try { numToStr.call(value); return true; } catch (e) { return false; } }; var toStr = Object.prototype.toString; var numClass = '[object Number]'; var hasToStringTag = require('has-tostringtag/shams')(); module.exports = function isNumberObject(value) { if (typeof value === 'number') { return true; } if (typeof value !== 'object') { return false; } return hasToStringTag ? tryNumberObject(value) : toStr.call(value) === numClass; }; is-number-object-1.0.7/package.json000066400000000000000000000044231422175250600171610ustar00rootroot00000000000000{ "name": "is-number-object", "version": "1.0.7", "author": "Jordan Harband ", "funding": { "url": "https://github.com/sponsors/ljharb" }, "description": "Is this value a JS Number object? This module works cross-realm/iframe, and despite ES6 @@toStringTag.", "main": "index.js", "scripts": { "prepublishOnly": "safe-publish-latest", "prepublish": "not-in-publish || npm run prepublishOnly", "pretest": "npm run lint", "tests-only": "nyc tape 'test/**/*.js'", "test:corejs": "nyc tape test-corejs.js", "test": "npm run tests-only && npm run test:corejs", "posttest": "aud --production", "prelint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git')", "lint": "eslint --ext=js,mjs .", "version": "auto-changelog && git add CHANGELOG.md", "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" }, "repository": { "type": "git", "url": "git://github.com/inspect-js/is-number-object.git" }, "keywords": [ "Number", "ES6", "toStringTag", "@@toStringTag", "Number object" ], "license": "MIT", "bugs": { "url": "https://github.com/inspect-js/is-number-object/issues" }, "homepage": "https://github.com/inspect-js/is-number-object#readme", "devDependencies": { "@ljharb/eslint-config": "^20.2.3", "aud": "^2.0.0", "auto-changelog": "^2.4.0", "core-js": "^3.21.1", "eclint": "^2.8.1", "eslint": "=8.8.0", "foreach": "^2.0.5", "indexof": "^0.0.1", "is": "^3.3.0", "nyc": "^10.3.2", "safe-publish-latest": "^2.0.0", "tape": "^5.5.2" }, "testling": { "files": "test/index.js", "browsers": [ "iexplore/6.0..latest", "firefox/3.0..6.0", "firefox/15.0..latest", "firefox/nightly", "chrome/4.0..10.0", "chrome/20.0..latest", "chrome/canary", "opera/10.0..latest", "opera/next", "safari/4.0..latest", "ipad/6.0..latest", "iphone/6.0..latest", "android-browser/4.2" ] }, "engines": { "node": ">= 0.4" }, "auto-changelog": { "output": "CHANGELOG.md", "template": "keepachangelog", "unreleased": false, "commitLimit": false, "backfillLimit": false, "hideCredit": true }, "dependencies": { "has-tostringtag": "^1.0.0" } } is-number-object-1.0.7/test-corejs.js000066400000000000000000000000671422175250600174730ustar00rootroot00000000000000'use strict'; require('core-js'); require('./test'); is-number-object-1.0.7/test/000077500000000000000000000000001422175250600156475ustar00rootroot00000000000000is-number-object-1.0.7/test/index.js000066400000000000000000000024471422175250600173230ustar00rootroot00000000000000'use strict'; var test = require('tape'); var isNumber = require('../'); var hasToStringTag = require('has-tostringtag/shams')(); test('not Numbers', function (t) { t.notOk(isNumber(), 'undefined is not Number'); t.notOk(isNumber(null), 'null is not Number'); t.notOk(isNumber(false), 'false is not Number'); t.notOk(isNumber(true), 'true is not Number'); t.notOk(isNumber('foo'), 'string is not Number'); t.notOk(isNumber([]), 'array is not Number'); t.notOk(isNumber({}), 'object is not Number'); t.notOk(isNumber(function () {}), 'function is not Number'); t.notOk(isNumber(/a/g), 'regex literal is not Number'); t.notOk(isNumber(new RegExp('a', 'g')), 'regex object is not Number'); t.notOk(isNumber(new Date()), 'new Date() is not Number'); t.end(); }); test('@@toStringTag', { skip: !hasToStringTag }, function (t) { var fakeNumber = { toString: function () { return '7'; }, valueOf: function () { return 42; } }; fakeNumber[Symbol.toStringTag] = 'Number'; t.notOk(isNumber(fakeNumber), 'fake Number with @@toStringTag "Number" is not Number'); t.end(); }); test('Numbers', function (t) { t.ok(isNumber(42), 'number is Number'); t.ok(isNumber(Object(42)), 'number object is Number'); t.ok(isNumber(NaN), 'NaN is Number'); t.ok(isNumber(Infinity), 'Infinity is Number'); t.end(); });