4 ms·
This JavaScript implementation is up to date https://github.com/bruth/jsonpatch-js https://github.com/bruth/jsonpatch-js (I am the author)
by bruth 14y ago
This JavaScript implementation is up to date https://github.com/bruth/jsonpatch-js https://github.com/bruth/jsonpatch-js
(I am the author)
- simonw 14y agoDo you know of a good library for generating a patch from two JSON structures that, when applied to structure A, would produce structure B?
- bruth 14y agoI implemented this a while back, but have not yet cleaned it up nor turned it into a library: http://jsfiddle.net/bruth/p6SUF/ http://jsfiddle.net/bruth/p6SUF/ Open up the console to see the output. Here is slightly cleaner one that I plan to submit as a feature to Backbone. It assumes underscore.js is present: https://github.com/bruth/backbone/commit/a7f8bd3d9fa06a63cf429ab15519f80965d78208#L0R1491 https://github.com/bruth/backbone/commit/a7f8bd3d9fa06a63cf4... Here is a JSFiddle example: http://jsfiddle.net/bruth/pwpNw/ http://jsfiddle.net/bruth/pwpNw/ (Open up the console to see the output) EDIT: Add JSFiddle example for second implementation