Tixit / odiff

Gets a list of differences between two javascript values.
MIT License
88 stars 13 forks source link

Adding Removed Values #10

Closed TheScree closed 5 years ago

TheScree commented 5 years ago

I'm not a fan of the structure of returns being different depending on what happened (add/removes/updates/etc). I've been using deep-diff for the last few years and the format of outputs makes it easy/predictable to handle the results.

When an object is removed, you do not list the value of what was removed. I am writing an automatic patchnotes generator based on changes in data. It describes in natural english what changes are occuring to the data. Reverse looking up paths with the index and path is a nuisance considering you have access to the values when performing your lookups. From a technical debt standpoint it would make more sense to have the values in "rm" modes included like you do with "add".

Any chance of adding values to the "rm" type?

fresheneesz commented 5 years ago

Sure, that seems reasonable. Want to write a pull request?

TheScree commented 5 years ago

Would that I could haha ;)

I'm not a talented enough developer to figure this out with the sleep-deprived baby-crying state I find myself living in.

If anyone is open to it, would greatly appreciate it. This is far more useful of a library for my purposes and this would be an incredibly useful feature.

fresheneesz commented 5 years ago

Ok your wish has been granted. In v1.3.0