Socket
Socket
Sign inDemoInstall

deep-is

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.0 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",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc