Socket
Socket
Sign inDemoInstall

just-diff-apply

Package Overview
Dependencies
0
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.1.0 to 3.1.2

23

index.esm.js

@@ -1,6 +0,1 @@

var collectionDiffApply = {
diffApply: diffApply,
jsonPatchPathConverter: jsonPatchPathConverter,
};
/*

@@ -73,3 +68,5 @@ const obj1 = {a: 3, b: 5};

if (!Array.isArray(thisPath)) {
throw new Error('diff path must be an array, consider supplying a path converter');
throw new Error(
'diff path must be an array, consider supplying a path converter'
);
}

@@ -83,3 +80,3 @@ }

var thisProp;
while (((thisProp = pathCopy.shift())) != null) {
while ((thisProp = pathCopy.shift()) != null) {
if (!(thisProp in subObject)) {

@@ -92,7 +89,13 @@ subObject[thisProp] = {};

if (!subObject.hasOwnProperty(lastProp)) {
throw new Error(['expected to find property', thisDiff.path, 'in object', obj].join(' '));
throw new Error(
['expected to find property', thisDiff.path, 'in object', obj].join(
' '
)
);
}
}
if (thisOp === REMOVE) {
Array.isArray(subObject) ? subObject.splice(lastProp, 1) : delete subObject[lastProp];
Array.isArray(subObject)
? subObject.splice(lastProp, 1)
: delete subObject[lastProp];
}

@@ -110,2 +113,2 @@ if (thisOp === REPLACE || thisOp === ADD) {

export { collectionDiffApply as default };
export {diffApply, jsonPatchPathConverter};
{
"name": "just-diff-apply",
"version": "3.1.0",
"version": "3.1.2",
"description": "Apply a diff to an object. Optionally supports jsonPatch protocol",
"type": "commonjs",
"main": "index.js",

@@ -7,0 +6,0 @@ "module": "index.esm.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