If one property value of both objects is same it setting to null or empty, but I don't want to set anything if both property values are same. How do I do that?
obj1 = { name: 'red', age: 12 }
obj2 = { name: 'yellow' age: 12 }
jsonPatch.compare(obj1, obj2);
Output:
{ op: "replace", path: "/Name", value: "yellow"},
{ op: "replace", path: "/age", value: ""},
I don't want to update age if it is same