A class allowing the application of JSON Patch Documents corresponding to: draft-pbryan-json-patch-04 http://tools.ietf.org/html/draft-pbryan-json-patch-04 with the addition of 'value' in 'remove' operation and 'replacedValue' in 'replace' operation. These additions allow for both forward and reverse JSON patching.
I believe your pointer implementation will not handle objects with member names containing slash '/' characters. I wouldn't do anything about this until the next JSON Pointer draft is published; we're going to change the way we represent such member names in pointers.
Greg:
Need to URI percent decode prior to key lookup on JSON object.
I see you're avoiding the remove/add/replace operations on the root value. I would document this as a limitation, as the specification makes these operations are valid to apply to the root object. If you can work around such limitations, that would be better.
I'm curious if there are other ways you could undo patches without needing to store removed/replaced value. For example, your runPatch function could generated and return an "undo" patch document that effectively undoes the work of the patch it's applying.
Greg:
Bandwidth considerations needed for 'undo' patch. Looking for more feedback from peers on this issue.