peach a19a732be8 commit message | 2 years ago | |
---|---|---|
.. | ||
.github | 2 years ago | |
test | 2 years ago | |
.editorconfig | 2 years ago | |
.eslintignore | 2 years ago | |
.eslintrc | 2 years ago | |
.nycrc | 2 years ago | |
CHANGELOG.md | 2 years ago | |
LICENSE | 2 years ago | |
README.md | 2 years ago | |
index.js | 2 years ago | |
package.json | 2 years ago |
Is this value negative zero? === will lie to you.
var isNegativeZero = require('is-negative-zero');
var assert = require('assert');
assert.notOk(isNegativeZero(undefined));
assert.notOk(isNegativeZero(null));
assert.notOk(isNegativeZero(false));
assert.notOk(isNegativeZero(true));
assert.notOk(isNegativeZero(0));
assert.notOk(isNegativeZero(42));
assert.notOk(isNegativeZero(Infinity));
assert.notOk(isNegativeZero(-Infinity));
assert.notOk(isNegativeZero(NaN));
assert.notOk(isNegativeZero('foo'));
assert.notOk(isNegativeZero(function () {}));
assert.notOk(isNegativeZero([]));
assert.notOk(isNegativeZero({}));
assert.ok(isNegativeZero(-0));
Simply clone the repo, npm install
, and run npm test