🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

deep-is

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deep-is - npm Package Compare versions

Comparing version

to
0.1.1

test/neg-vs-pos-0.js

13

index.js

@@ -12,4 +12,8 @@ var pSlice = Array.prototype.slice;

var deepEqual = module.exports = function (actual, expected) {
// enforce Object.is +0 !== -0
if (actual === 0 && expected === 0) {
return areZerosEqual(actual, expected);
// 7.1. All identical values are equivalent, as determined by ===.
if (actual === expected) {
} else if (actual === expected) {
return true;

@@ -37,3 +41,3 @@

}
}
};

@@ -53,2 +57,7 @@ function isUndefinedOrNull(value) {

function areZerosEqual(zeroA, zeroB) {
// (1 / +0|0) -> Infinity, but (1 / -0) -> -Infinity and (Infinity !== -Infinity)
return (1 / zeroA) === (1 / zeroB);
}
function objEquiv(a, b) {

@@ -55,0 +64,0 @@ if (isUndefinedOrNull(a) || isUndefinedOrNull(b))

2

package.json
{
"name": "deep-is",
"version": "0.1.0",
"version": "0.1.1",
"description": "node's assert.deepEqual algorithm except for NaN being equal to NaN",

@@ -5,0 +5,0 @@ "main": "index.js",