Socket
Socket
Sign inDemoInstall

fast-deep-equal

Package Overview
Dependencies
0
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.0-beta.1 to 3.0.0-beta.2

37

es6/index.js

@@ -5,2 +5,6 @@ 'use strict';

var envHasBigInt64Array = typeof BigInt64Array !== 'undefined';
module.exports = function equal(a, b) {

@@ -12,3 +16,3 @@ if (a === b) return true;

var length, i, key, keys;
var length, i, keys;
if (Array.isArray(a)) {

@@ -25,12 +29,8 @@ length = a.length;

if (a.size !== b.size) return false;
for(i of a.entries())
if (!b.has(i[0])) return false;
keys = getKeys(a);
for (i = a.size; i-- !== 0;)
if (!b.has(keys[i])) return false;
for(i of a.entries())
if (!equal(i[1], b.get(i[0]))) return false;
for (i = a.size; i-- !== 0;) {
key = keys[i];
if (!equal(a.get(key), b.get(key))) return false;
}
return true;

@@ -41,7 +41,5 @@ }

if (a.size !== b.size) return false;
for(i of a.entries())
if (!b.has(i[0])) return false;
keys = getKeys(a);
for (i = a.size; i-- !== 0;)
if (!b.has(keys[i])) return false;
return true;

@@ -60,4 +58,3 @@ }

a instanceof Float64Array ||
a instanceof BigInt64Array ||
a instanceof BigUint64Array
(envHasBigInt64Array && (a instanceof BigInt64Array || a instanceof BigUint64Array))
)) {

@@ -84,3 +81,3 @@ length = a.length;

for (i = length; i-- !== 0;) {
key = keys[i];
var key = keys[i];
if (!equal(a[key], b[key])) return false;

@@ -95,9 +92,1 @@ }

};
function getKeys(a) {
var keys = [];
for (var [key] of a.entries()) keys.push(key);
return keys;
}

@@ -5,2 +5,4 @@ 'use strict';

module.exports = function equal(a, b) {

@@ -12,3 +14,3 @@ if (a === b) return true;

var length, i, key, keys;
var length, i, keys;
if (Array.isArray(a)) {

@@ -36,3 +38,3 @@ length = a.length;

for (i = length; i-- !== 0;) {
key = keys[i];
var key = keys[i];
if (!equal(a[key], b[key])) return false;

@@ -47,3 +49,1 @@ }

};
{
"name": "fast-deep-equal",
"version": "3.0.0-beta.1",
"version": "3.0.0-beta.2",
"description": "Fast deep equal",

@@ -9,2 +9,3 @@ "main": "index.js",

"build": "node build",
"benchmark": "npm i && npm run build && cd ./benchmark && npm i && node ./",
"test-spec": "mocha spec/*.spec.js -R spec",

@@ -32,17 +33,9 @@ "test-cov": "nyc npm run test-spec",

"devDependencies": {
"benchmark": "^2.1.4",
"coveralls": "^2.13.1",
"deep-eql": "latest",
"deep-equal": "latest",
"dot": "^1.1.2",
"eslint": "^4.0.0",
"lodash": "latest",
"mocha": "^3.4.2",
"nano-equal": "latest",
"nyc": "^11.0.2",
"pre-commit": "^1.2.2",
"ramda": "latest",
"shallow-equal-fuzzy": "latest",
"typescript": "^2.6.1",
"underscore": "latest"
"typescript": "^2.6.1"
},

@@ -49,0 +42,0 @@ "nyc": {

@@ -80,5 +80,3 @@ # fast-deep-equal

```bash
npm install
npm run build
node benchmark
npm run benchmark
```

@@ -85,0 +83,0 @@

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