just-compare
Advanced tools
Comparing version 1.1.21 to 1.2.0
@@ -21,2 +21,5 @@ module.exports = compare; | ||
} | ||
if (Number.isNaN(value1) && Number.isNaN(value2)) { | ||
return true; | ||
} | ||
if (typeof value1 != typeof value2) { | ||
@@ -35,3 +38,3 @@ return false; | ||
} | ||
if (({}).toString.call(value1) == '[object Object]') { | ||
if ({}.toString.call(value1) == '[object Object]') { | ||
return compareObjects(value1, value2); | ||
@@ -73,3 +76,3 @@ } else { | ||
var key2 = keys2[i]; | ||
if (!((key1 == key2) && (compare(value1[key1], value2[key2])))) { | ||
if (!(key1 == key2 && compare(value1[key1], value2[key2]))) { | ||
return false; | ||
@@ -76,0 +79,0 @@ } |
{ | ||
"name": "just-compare", | ||
"version": "1.1.21", | ||
"version": "1.2.0", | ||
"description": "compare two collections", | ||
@@ -10,9 +10,3 @@ "main": "index.js", | ||
"repository": "https://github.com/angus-c/just", | ||
"keywords": [ | ||
"object", | ||
"array", | ||
"compare", | ||
"no-dependencies", | ||
"just" | ||
], | ||
"keywords": ["object", "array", "compare", "no-dependencies", "just"], | ||
"author": "Angus Croll", | ||
@@ -19,0 +13,0 @@ "license": "MIT", |
@@ -22,2 +22,3 @@ ## just-compare | ||
compare([[1, [2, {a: 4}], 4], [[1, [2, {a: 4}]]); // true | ||
compare(NaN, NaN); // true | ||
``` |
3294
74
24