Open mnot opened 10 years ago
Also see cujojs/jiff#15 - brainstorming possible ways to allow inversion.
I personally lean towards https://github.com/cujojs/jiff/issues/15#issuecomment-42357803, 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.
See: https://github.com/cujojs/jiff/issues/9