deep-object-diff
deep-object-diff copied to clipboard
Deep diffs two objects, including nested structures of arrays and objects, and returns the difference. ❄️
NaN cannot be checked as equality. This commit add a test based on isNaN
Hey guys, I've created some more accurate Typescript definitions for `deep-object-diff`. I would be happy if you merge them, so I can use them directly from the npm module :)
Your examples with works fine execpt when the values compared in the array are objects. For example. this will work fine: ``` // added (end of array) const left =...
In order to compare objects, I want to filter some keys. For example: ``` lhs = { "name": "a", "phone": "b" } rhs = { "name": "a", "phone": "c" }...
When I compare two arrays: 1st arg = ['a', 'b', 'c'] and 2nd arg = ['a', 'b'] results in object: { '2': undefined } I would expect -- given your...
When I diff `['a', 'b', 'c']` and `['b', 'c']`, the result is: ``` { added: {}, deleted: { '2': undefined }, updated: { '0': 'b', '1': 'c' } } ```...
To reproduce: `const deepObjectDiff = require("deep-object-diff"); let a = new Array(10000); for(let i=0; i
Unfortunately I am forced to use the dist bundle to include the feature into my application (with a good old script tag). I found that you populate the lib methods...
Would something like this make sense? If so I can submit a PR. ```typescript export type DetailedDiffResult = { deleted: object; added: object; updated: object; }; export function detailedDiff( originalObj:...
basically, each diff type can have an additional flag, `areSame`, which is set true if the objects are the same. This functionality can be achieved with this: ``` const result...