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

just-diff

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

just-diff - npm Package Compare versions

Comparing version

to
3.0.1

18

index.js

@@ -77,2 +77,7 @@ module.exports = {

pathConverter ||
(pathConverter = function(arr) {
return arr;
});
function getDiff(obj1, obj2, basePath, diffs) {

@@ -91,3 +96,3 @@ var obj1Keys = Object.keys(obj1);

op: 'remove',
path: pathConverter ? pathConverter(path) : path,
path: pathConverter(path),
});

@@ -106,3 +111,3 @@ }

op: 'add',
path: pathConverter ? pathConverter(path) : path,
path: pathConverter(path),
value: obj2Value,

@@ -127,3 +132,8 @@ });

return diffs.remove.concat(diffs.replace).concat(diffs.add);
return diffs.remove
.sort(function(a, b) {
return b.path > a.path ? 1 : -1;
})
.concat(diffs.replace)
.concat(diffs.add);
}

@@ -137,3 +147,3 @@ return getDiff(obj1, obj2, [], {remove: [], replace: [], add: []});

op: 'replace',
path: pathConverter ? pathConverter(path) : path,
path: pathConverter(path),
value: obj2[key],

@@ -140,0 +150,0 @@ });

{
"name": "just-diff",
"version": "3.0.0",
"version": "3.0.1",
"description": "Return an object representing the diffs between two objects. Supports jsonPatch protocol",

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