inspect-js / node-deep-equal

node's assert.deepEqual algorithm
MIT License
778 stars 109 forks source link

Feature request: point discrepancy that caused inequality #101

Closed 3e-maciej closed 1 year ago

3e-maciej commented 1 year ago

Sometimes during debug it is hard to determine which exact property/entry/other in nested objects caused inequality. Serializing both and comparing manually is not easy as items may be in different order. Maybe you could provide some execution flag or separate method that instead of bool returns path to discrepancy?

ljharb commented 1 year ago

That's a pretty complex feature to have and to add. It does already exist in another package of mine, though - https://npmjs.com/is-equal, if you use the is-equal/why function, you'll get a string explaining why they're not equal.

3e-maciej commented 1 year ago

great. thanks!