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

shallowequal

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shallowequal - npm Package Compare versions

Comparing version

to
1.0.1

16

index.js
module.exports = function shallowEqual(objA, objB, compare, compareContext) {
let ret = compare ? compare.call(compareContext, objA, objB) : void 0;
var ret = compare ? compare.call(compareContext, objA, objB) : void 0;

@@ -18,4 +18,4 @@ if(ret !== void 0) {

const keysA = Object.keys(objA);
const keysB = Object.keys(objB);
var keysA = Object.keys(objA);
var keysB = Object.keys(objB);

@@ -26,8 +26,8 @@ if(keysA.length !== keysB.length) {

const bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);
var bHasOwnProperty = Object.prototype.hasOwnProperty.bind(objB);
// Test for A's keys different from B.
for(let idx = 0; idx < keysA.length; idx++) {
for(var idx = 0; idx < keysA.length; idx++) {
const key = keysA[idx];
var key = keysA[idx];

@@ -38,4 +38,4 @@ if(!bHasOwnProperty(key)) {

const valueA = objA[key];
const valueB = objB[key];
var valueA = objA[key];
var valueB = objB[key];

@@ -42,0 +42,0 @@ ret = compare ? compare.call(compareContext, valueA, valueB, key) : void 0;

{
"name": "shallowequal",
"version": "1.0.0",
"version": "1.0.1",
"description": "Like lodash isEqualWith but for shallow equal.",

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