web 3d图形渲染器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.8 KiB

  1. # is-number-object <sup>[![Version Badge][2]][1]</sup>
  2. [![Build Status][3]][4]
  3. [![dependency status][5]][6]
  4. [![dev dependency status][7]][8]
  5. [![License][license-image]][license-url]
  6. [![Downloads][downloads-image]][downloads-url]
  7. [![npm badge][11]][1]
  8. Is this value a JS Number object? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
  9. ## Example
  10. ```js
  11. var isNumber = require('is-number-object');
  12. var assert = require('assert');
  13. assert.notOk(isNumber(undefined));
  14. assert.notOk(isNumber(null));
  15. assert.notOk(isNumber(false));
  16. assert.notOk(isNumber(true));
  17. assert.notOk(isNumber('foo'));
  18. assert.notOk(isNumber(function () {}));
  19. assert.notOk(isNumber([]));
  20. assert.notOk(isNumber({}));
  21. assert.notOk(isNumber(/a/g));
  22. assert.notOk(isNumber(new RegExp('a', 'g')));
  23. assert.notOk(isNumber(new Date()));
  24. assert.ok(isNumber(42));
  25. assert.ok(isNumber(NaN));
  26. assert.ok(isNumber(Infinity));
  27. assert.ok(isNumber(new Number(42)));
  28. ```
  29. ## Tests
  30. Simply clone the repo, `npm install`, and run `npm test`
  31. [1]: https://npmjs.org/package/is-number-object
  32. [2]: http://versionbadg.es/inspect-js/is-number-object.svg
  33. [3]: https://travis-ci.org/inspect-js/is-number-object.svg
  34. [4]: https://travis-ci.org/inspect-js/is-number-object
  35. [5]: https://david-dm.org/inspect-js/is-number-object.svg
  36. [6]: https://david-dm.org/inspect-js/is-number-object
  37. [7]: https://david-dm.org/inspect-js/is-number-object/dev-status.svg
  38. [8]: https://david-dm.org/inspect-js/is-number-object#info=devDependencies
  39. [11]: https://nodei.co/npm/is-number-object.png?downloads=true&stars=true
  40. [license-image]: http://img.shields.io/npm/l/is-number-object.svg
  41. [license-url]: LICENSE
  42. [downloads-image]: http://img.shields.io/npm/dm/is-number-object.svg
  43. [downloads-url]: http://npm-stat.com/charts.html?package=is-number-object