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.

51 lines
1.7 KiB

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