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