object-utility-methods
v2.0.0
Published
exposes helper methods to analysis and manipulating objects
Downloads
8
Readme
compare two payload, if they are equal or not recursively and return true or false.
Installation guides
npm i object-utility-methods
Sample Examples:
Example 1:
const payload1 = {
a: { k: "v" },
b: { c: { d: "test", e: [{ c: 1, d: 2, e: [1, 2] }] } },
};
const payload2 = {
a: { k: "v" },
b: { c: { d: "test", e: [{ c: 1, e: [1, 2], d: 2 }] } },
};
const { objectUtils: { isBothObjectSame } } = require("object-utility-methods");
console.log(isBothObjectSame(payload1, payload2)); // true
Example 2:
const payload1 = {
a: { k: "v" },
b: { c: { d: "test", e: [{ c: 1, d: 2, e: [1, 2] }], l: 3 } },
};
const payload2 = {
a: { k: "v" },
b: { c: { d: "test", e: [{ c: 1, e: [1, 2], d: 2 }] } },
};
const { objectUtils: { isBothObjectSame } } = require("object-utility-methods");
console.log(isBothObjectSame(payload1, payload2)); // false