theKashey / proxyequal

There is a bit more smart way to compare things, than a shallow equal.
MIT License
72 stars 7 forks source link

How to check wich affected keys did change? #26

Open pie6k opened 4 years ago

pie6k commented 4 years ago

First of,

Thanks for this lib! It's great for performance improvements.

However, I've got quite large objects to compare, and they're not equal, but they should, and I want to inspect which property did change.

Is it possible to use compare and get some debug reports eg. Not equal because .key.otherkey.something is not equal

theKashey commented 4 years ago

There is stable, but not documented API - drainDifference, you might call after each comparison. It would return an array or arrays, where the first element of array would be a keyName you are looking for.

However, feel free just to perform deep shallow test to find the difference between two objects, like here.