Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

is-negative-zero

inspect-js87mMIT2.0.3TypeScript support: included

Is this value negative zero? === will lie to you

is, negative, zero, negative zero, number, positive, 0, -0

readme

is-negative-zero Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

Is this value negative zero? === will lie to you.

Example

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));

Tests

Simply clone the repo, npm install, and run npm test

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

v2.0.3 - 2024-02-19

Commits

  • add types e28f0d5
  • [meta] use npmignore to autogenerate an npmignore file f68ec13
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, auto-changelog, tape 70abff7
  • [actions] update rebase action to use reusable workflow 6e1356e
  • [Dev Deps] update @ljharb/eslint-config, aud, npmignore, tape c00d4ab
  • [meta] add sideEffects flag 9c45539

v2.0.2 - 2021-12-10

Commits

  • [actions] reuse common workflows ece923d
  • [actions] use node/install instead of node/run; use codecov action 3a26f43
  • [meta] do not publish workflow files 2cea0c2
  • [readme] add github actions/codecov badges; update URLs 0c0be3e
  • [Dev Deps] update eslint, @ljharb/eslint-config, safe-publish-latest, tape a93d16e
  • [meta] create FUNDING.yml b4f425e
  • [actions] update codecov uploader 7999db3
  • [Dev Deps] update eslint, @ljharb/eslint-config, auto-changelog, safe-publish-latest, tape 140e4d9
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, tape 23a8b6d
  • [readme] add actions and codecov badges fe92126
  • [readme] fix repo URLs 50c428e
  • [Dev Deps] update eslint, @ljharb/eslint-config, tape 688155f
  • [meta] use prepublishOnly script for npm 7+ 83171f9
  • [actions] update workflows e9823db

v2.0.1 - 2020-12-04

Commits

  • [Tests] use shared travis-ci configs 5b92482
  • [Tests] up to node v11.7, v10.15, v9.11, v8.15, v7.10, v6.16, v5.12, v4.9; use nvm install-latest-npm; fix test scripts 0f5d2f8
  • [Tests] migrate tests to Github Actions b80f05a
  • [Tests] remove jscs 7ccaf41
  • [meta] add missing changelog 992bdde
  • [readme] fix repo URLs; remove defunct badges 80fd18d
  • [Tests] run nyc on all tests df26f14
  • Update tape, jscs, eslint, @ljharb/eslint-config d7723aa
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, auto-changelog, tape 9fdaabe
  • [Dev Deps] update eslint, @ljharb/eslint-config, covert, tape f07eeb2
  • [Dev Deps] update tape, jscs, eslint, @ljharb/eslint-config bd5c751
  • [actions] add automatic rebasing / merge commit blocking 5666a91
  • [meta] add auto-changelog f70fb2b
  • [actions] add "Allow Edits" workflow 2b040a8
  • [Dev Deps] update eslint, @ljharb/eslint-config, tape; add safe-publish-latest 09e2e53
  • [Tests] use npm audit instead of nsp 7df2669
  • [Tests] up to io.js v3.3, node v4.1 4ff97c5
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, auto-changelog 9e8cb7b
  • [Dev Deps] update jscs, eslint, @ljharb/eslint-config, nsp 70b9888
  • [Dev Deps] update jscs 59d0c42
  • Add npm run security eb418ed
  • [Dev Deps] update eslint, @ljharb/eslint-config, tape 86a758d
  • Only apps should have lockfiles a0ab621
  • [Tests] use npx aud instead of nsp or npm audit with hoops 5c51349
  • [meta] add funding field 1d0b2f4
  • [actions] switch Automatic Rebase workflow to pull_request_target event 9b12367
  • [Dev Deps] update auto-changelog, tape 6d98b8d
  • [Dev Deps] Update tape, eslint a258cdb
  • [Dev Deps] update auto-changelog; add aud 2ca2afb
  • Test up to io.js v3.0 1254ae8
  • [Dev Deps] update auto-changelog 4b54722
  • [Tests] only audit prod deps 86d298b
  • [Dev Deps] update tape 3a47e27
  • Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG. 128d9bd

v2.0.0 - 2015-07-24

Commits

v1.0.0 - 2014-08-08

Commits

v0.1.1 - 2014-05-13

Merged

  • Simplify code #1

Commits

  • Adding a trailing newline 61fb37f

v0.1.0 - 2014-05-13

Commits

  • Make sure old and unstable nodes don't break Travis f627215
  • Updating deps b502f48
  • Oops, negative numbers were negative zero! 746cb97
  • Updating covert 99ef4ed
  • Updating tape ee9cfc2
  • Testing on node 0.6 again 6a9bf0a

v0.0.0 - 2014-01-19

Commits