Socket
Socket
Sign inDemoInstall

iridium

Package Overview
Dependencies
26
Maintainers
1
Versions
157
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.2.4 to 7.2.5

dist/test/issues/#83.d.ts

12

dist/lib/utils/Omnom.js

@@ -89,4 +89,9 @@ "use strict";

for (; i < original.length && j < modified.length; i++) {
if (this.almostEqual(original[i], modified[j]))
const equalityDistance = this.almostEqual(original[i], modified[j]);
if (equalityDistance == 1)
j++;
else if (equalityDistance > 0)
// If we would need to both pull and $set on this array, we have to
// just use the $set operator.
return this.set(changePath, modified);
else

@@ -103,4 +108,5 @@ pulls.push(original[i]);

}
else
return this.set(changePath, modified);
// If we have a smaller target array than our source, we will need to re-create it
// regardless (if we want to do so in a single operation anyway)
return this.set(changePath, modified);
}

@@ -107,0 +113,0 @@ onLargerArray(original, modified, changePath) {

@@ -262,4 +262,27 @@ "use strict";

});
it("should handle complex array objects which should be replaced in a smaller array", () => {
let oldObject = { a: [{ x: 1, y: "a" }, { x: 2, y: "b" }, { x: 3, y: "c" }, { x: 4, y: "d" }] };
let newObject = { a: [{ x: 1, y: "z" }, { x: 2, y: "y" }] };
let expectedDiff = {
$set: {
"a": [{ x: 1, y: "z" }, { x: 2, y: "y" }]
}
};
chai.expect(Omnom_1.Omnom.diff(oldObject, newObject)).to.exist.and.be.eql(expectedDiff);
});
it("should handle complex array objects which should be replaced in a larger array", () => {
let oldObject = { a: [{ x: 1, y: "a" }, { x: 2, y: "b" }] };
let newObject = { a: [{ x: 1, y: "z" }, { x: 2, y: "y" }, { x: 3, y: "x" }, { x: 4, y: "w" }] };
let expectedDiff = {
$set: {
"a.0.y": "z",
"a.1.y": "y",
"a.2": { x: 3, y: "x" },
"a.3": { x: 4, y: "w" }
}
};
chai.expect(Omnom_1.Omnom.diff(oldObject, newObject)).to.exist.and.be.eql(expectedDiff);
});
});
});
//# sourceMappingURL=Omnom.js.map
{
"name": "iridium",
"version": "7.2.4",
"version": "7.2.5",
"author": "Benjamin Pannell <admin@sierrasoftworks.com>",

@@ -5,0 +5,0 @@ "description": "A custom lightweight ORM for MongoDB designed for power-users",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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