Patch Inversion
Opened this issue · 2 comments
mnot commented
See:
cujojs/jiff#9
briancavalier commented
Also see cujojs/jiff#15 - brainstorming possible ways to allow inversion.
espadrine commented
I personally lean towards cujojs/jiff#15 (comment), using the key was. I implemented that in https://github.com/espadrine/json-diff.
However, there's a small catch: if an add operation was generated, but it replaces data instead of just adding it, its inverse won't yield the original document. I suppose the patch generator has to ensure that they only use add as a strict add.