is-negative-zero
Advanced tools
Comparing version 1.0.0 to 2.0.0
@@ -1,7 +0,6 @@ | ||
"use strict"; | ||
'use strict'; | ||
module.exports = function isNegativeZero(value) { | ||
var number = Number(value); | ||
module.exports = function isNegativeZero(number) { | ||
return number === 0 && (1 / number) === -Infinity; | ||
}; | ||
{ | ||
"name": "is-negative-zero", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "Is this value negative zero? === will lie to you", | ||
@@ -9,5 +9,8 @@ "author": "Jordan Harband", | ||
"scripts": { | ||
"test": "node test.js && npm run coverage-quiet", | ||
"test": "npm run lint && node test.js && npm run coverage-quiet", | ||
"coverage": "covert test.js", | ||
"coverage-quiet": "covert test.js --quiet" | ||
"coverage-quiet": "covert test.js --quiet", | ||
"lint": "npm run jscs && npm run eslint", | ||
"jscs": "jscs *.js", | ||
"eslint": "eslint *.js" | ||
}, | ||
@@ -34,4 +37,7 @@ "repository": { | ||
"devDependencies": { | ||
"tape": "~2.14.0", | ||
"covert": "~0.4.0" | ||
"tape": "^4.0.1", | ||
"covert": "^1.1.0", | ||
"jscs": "^1.13.1", | ||
"eslint": "^1.0.0-rc-3", | ||
"@ljharb/eslint-config": "^1.0.3" | ||
}, | ||
@@ -38,0 +44,0 @@ "testling": { |
#is-negative-zero <sup>[![Version Badge][2]][1]</sup> | ||
[![Build Status][3]][4] [![dependency status][5]][6] [![dev dependency status][7]][8] | ||
[![Build Status][3]][4] | ||
[![dependency status][5]][6] | ||
[![dev dependency status][7]][8] | ||
[![License][license-image]][license-url] | ||
[![Downloads][downloads-image]][downloads-url] | ||
@@ -39,7 +43,7 @@ [![npm badge][11]][1] | ||
[2]: http://vb.teelaun.ch/ljharb/is-negative-zero.svg | ||
[3]: https://travis-ci.org/ljharb/is-negative-zero.png | ||
[3]: https://travis-ci.org/ljharb/is-negative-zero.svg | ||
[4]: https://travis-ci.org/ljharb/is-negative-zero | ||
[5]: https://david-dm.org/ljharb/is-negative-zero.png | ||
[5]: https://david-dm.org/ljharb/is-negative-zero.svg | ||
[6]: https://david-dm.org/ljharb/is-negative-zero | ||
[7]: https://david-dm.org/ljharb/is-negative-zero/dev-status.png | ||
[7]: https://david-dm.org/ljharb/is-negative-zero/dev-status.svg | ||
[8]: https://david-dm.org/ljharb/is-negative-zero#info=devDependencies | ||
@@ -49,2 +53,6 @@ [9]: https://ci.testling.com/ljharb/is-negative-zero.png | ||
[11]: https://nodei.co/npm/is-negative-zero.png?downloads=true&stars=true | ||
[license-image]: http://img.shields.io/npm/l/is-negative-zero.svg | ||
[license-url]: LICENSE | ||
[downloads-image]: http://img.shields.io/npm/dm/is-negative-zero.svg | ||
[downloads-url]: http://npm-stat.com/charts.html?package=is-negative-zero | ||
@@ -1,2 +0,2 @@ | ||
"use strict"; | ||
'use strict'; | ||
@@ -24,8 +24,2 @@ var test = require('tape'); | ||
test('things whose valueOf is negative zero', function (t) { | ||
t.ok(isNegativeZero({ valueOf: function () { return -0; } }), 'object with valueOf of negative zero is negative zero'); | ||
t.ok(isNegativeZero('-0'), 'string negative zero is negative zero'); | ||
t.end(); | ||
}); | ||
test('negative zero', function (t) { | ||
@@ -32,0 +26,0 @@ t.ok(isNegativeZero(-0), 'negative zero is negative zero'); |
Sorry, the diff of this file is not supported yet
9247
9
95
57
5