{"_id":"json-patch","_rev":"28-852847b17a9735d63cd94f9f558beb39","name":"json-patch","description":"A JavaScript implementation of the JSON Object Notation (JSON) Patch http://tools.ietf.org/html/rfc6902 and JSON Pointer http://tools.ietf.org/html/rfc6901 specifications.","dist-tags":{"latest":"0.7.0"},"versions":{"0.2.3":{"name":"json-patch","author":{"name":"Byron Ruth","email":"b@devel.io"},"version":"0.2.3","description":"A JavaScript implementation of the JSON Media Type for partial modifications: http://tools.ietf.org/html/draft-ietf-appsawg-json-patch-03","license":"BSD","keywords":["diff","patch","json","jsonpatch","jsonpointer"],"main":"jsonpatch.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/bruth/jsonpatch-js.git"},"_id":"json-patch@0.2.3","dist":{"shasum":"b6734521a97061c7913147dcc1ad0d04dac02420","tarball":"https://registry.npmjs.org/json-patch/-/json-patch-0.2.3.tgz","integrity":"sha512-GL/PJ0pupcw+O2s+1vpo/0sMipMTVBK86xG0ogD6d2wxHpDTn6rT+OQQjlccvDJKnnn5J2YoqakZHTPY/SfFbQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCUGrPQeqOF9ePYDt+dHx540xR0DeiOD/3riCTk7hFT+wIhANwnl90E0npyvfGLGjUQQZvh5r7gdKU53RKGF5WO0Tv4"}]},"_npmVersion":"1.1.65","_npmUser":{"name":"bruth","email":"b@devel.io"},"maintainers":[{"name":"bruth","email":"b@devel.io"}],"directories":{}},"0.3.0":{"name":"json-patch","author":{"name":"Byron Ruth","email":"b@devel.io"},"version":"0.3.0","description":"A JavaScript implementation of the JSON Media Type for partial modifications: http://tools.ietf.org/html/draft-ietf-appsawg-json-patch-06","license":"BSD","keywords":["diff","patch","json","jsonpatch","jsonpointer"],"main":"jsonpatch.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/bruth/jsonpatch-js.git"},"_id":"json-patch@0.3.0","dist":{"shasum":"c867f10119b46d413f6bd81127a884371ff9a9e8","tarball":"https://registry.npmjs.org/json-patch/-/json-patch-0.3.0.tgz","integrity":"sha512-G8Nsjbg20jp5DHjwuk32ZChLRLRyz73AF/GuWpPwKQ0IfL+7JNebctGDnPq0JdV1tH5QfAPTUJzY/I+Ve5N3HA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6xMRClu20oHlAMQmd/0bnoekgnONLwfwjmpTUTCIWjgIgSgfstL6jt0GJIEXa/8vtKYPusj2rRemm3e51bt0Ejv8="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"bruth","email":"b@devel.io"},"maintainers":[{"name":"bruth","email":"b@devel.io"}],"directories":{}},"0.4.0":{"name":"json-patch","author":{"name":"Byron Ruth","email":"b@devel.io"},"version":"0.4.0","description":"A JavaScript implementation of the JSON Media Type for partial modifications: http://tools.ietf.org/html/rfc6902","license":"BSD","keywords":["diff","patch","json","jsonpatch","jsonpointer"],"main":"jsonpatch.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/bruth/jsonpatch-js.git"},"_id":"json-patch@0.4.0","dist":{"shasum":"474f7eaa79f86ac0ee842b67ee323abb4ab7cbb5","tarball":"https://registry.npmjs.org/json-patch/-/json-patch-0.4.0.tgz","integrity":"sha512-LBcS443CScwOUulb1cIW//01P48xk9e82IlGHxW6MSLr278NjqstlhEY7ka7ZY9Lti9b3ascitXahzLCCp4sDw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGRUHvU1EZZ7RI24c0PXNI82hG3s/ZI6pnpGlZ3Z7UZeAiEAtzWHR4gUCuswYrvtEo/bD/sOD5rAuaLhiSH0vWbXLqQ="}]},"_from":".","_npmVersion":"1.2.18","_npmUser":{"name":"bruth","email":"b@devel.io"},"maintainers":[{"name":"bruth","email":"b@devel.io"}],"directories":{}},"0.4.1":{"name":"json-patch","author":{"name":"Byron Ruth","email":"b@devel.io"},"version":"0.4.1","description":"A JavaScript implementation of the JSON Media Type for partial modifications: http://tools.ietf.org/html/rfc6902","license":"BSD","keywords":["diff","patch","json","jsonpatch","jsonpointer"],"main":"jsonpatch.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/bruth/jsonpatch-js.git"},"bugs":{"url":"https://github.com/bruth/jsonpatch-js/issues"},"homepage":"https://github.com/bruth/jsonpatch-js","_id":"json-patch@0.4.1","dist":{"shasum":"3c7570048dc14f6f24821ac4ee278c1474e4d74e","tarball":"https://registry.npmjs.org/json-patch/-/json-patch-0.4.1.tgz","integrity":"sha512-n8jNGhZeF1P98Yv9DtaeMALOVS2FKYE9Db4IeOaIuXU5Ag4cWakJdwr+WDYVi4K2i6PtekHdj5cn2noiD2qv1A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCFFyfwef0QoARy2Ug45HOtWT+jF0RPQ2/5luqT98CfNwIhAOi/2IxZAonHWtBaY8XwB+xembh8BV3mADLjj2beTw+h"}]},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"bruth","email":"b@devel.io"},"maintainers":[{"name":"bruth","email":"b@devel.io"}]},"0.4.2":{"name":"json-patch","author":{"name":"Byron Ruth","email":"b@devel.io"},"version":"0.4.2","description":"A JavaScript implementation of the JSON Object Notation (JSON) Patch http://tools.ietf.org/html/rfc6902 and JSON Pointer http://tools.ietf.org/html/rfc6901 specifications.","license":"BSD","keywords":["diff","patch","json","jsonpatch","jsonpointer"],"main":"jsonpatch.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/bruth/jsonpatch-js.git"},"devDependencies":{"coffee-script":"^1.7.1"},"bugs":{"url":"https://github.com/bruth/jsonpatch-js/issues"},"homepage":"https://github.com/bruth/jsonpatch-js","_id":"json-patch@0.4.2","_shasum":"1eadcbda7d1275c624077b915ae28cd71913c52b","_from":".","_npmVersion":"1.4.10","_npmUser":{"name":"bruth","email":"b@devel.io"},"maintainers":[{"name":"bruth","email":"b@devel.io"}],"dist":{"shasum":"1eadcbda7d1275c624077b915ae28cd71913c52b","tarball":"https://registry.npmjs.org/json-patch/-/json-patch-0.4.2.tgz","integrity":"sha512-vS6M1YHCD6E0TlSofIQOC/8UFyqx9GkdyvyysxV4UL9fyzWWosXFkmyUV0Ho/UdW/O2zB5Bs6LexbGZiiQQ/RA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCM0UZdX1PBXorgXWhn/z/+/WY5w6itylpN2YbGxRJxpwIgauX7Y4YPldRoGvd55PO/SHplw9SbF8kGGK6E3UA65QU="}]}},"0.4.3":{"name":"json-patch","author":{"name":"Byron Ruth","email":"b@devel.io"},"version":"0.4.3","description":"A JavaScript implementation of the JSON Object Notation (JSON) Patch http://tools.ietf.org/html/rfc6902 and JSON Pointer http://tools.ietf.org/html/rfc6901 specifications.","license":"BSD","keywords":["diff","patch","json","jsonpatch","jsonpointer"],"main":"jsonpatch.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/bruth/jsonpatch-js.git"},"devDependencies":{"coffee-script":"^1.7.1"},"bugs":{"url":"https://github.com/bruth/jsonpatch-js/issues"},"homepage":"https://github.com/bruth/jsonpatch-js","_id":"json-patch@0.4.3","_shasum":"9ac27bbed892bb2dc716127ca9f527b55322f674","_from":".","_npmVersion":"1.4.10","_npmUser":{"name":"bruth","email":"b@devel.io"},"maintainers":[{"name":"bruth","email":"b@devel.io"}],"dist":{"shasum":"9ac27bbed892bb2dc716127ca9f527b55322f674","tarball":"https://registry.npmjs.org/json-patch/-/json-patch-0.4.3.tgz","integrity":"sha512-1REdE/i7mL1OdKhZ+1+CsA0vye1FBZbD7jtF2hbg6Q/j047wMy62UDcGP735Fxw6MoC+ys/0gSYhF0K8seFsXw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDhCopLeqQuRRLxbmDju6TNZzB2R3HryEw1fMk2iaQ6ywIhAJ5r1sqe0srryfQVA4pzX8/4ZrRwX/3T3Ry33/6u6EtC"}]}},"0.5.0":{"name":"json-patch","author":{"name":"Byron Ruth","email":"b@devel.io"},"version":"0.5.0","description":"A JavaScript implementation of the JSON Object Notation (JSON) Patch http://tools.ietf.org/html/rfc6902 and JSON Pointer http://tools.ietf.org/html/rfc6901 specifications.","license":"BSD","keywords":["diff","patch","json","jsonpatch","jsonpointer"],"main":"jsonpatch.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/bruth/jsonpatch-js.git"},"devDependencies":{"coffee-script":"^1.8.0"},"gitHead":"7ca4e90f262b50cc9fdc4b0f6dd573fa5dd2b3c5","bugs":{"url":"https://github.com/bruth/jsonpatch-js/issues"},"homepage":"https://github.com/bruth/jsonpatch-js","_id":"json-patch@0.5.0","_shasum":"1666932c9a1c22427fab3e3db5c6fa278a6aa58d","_from":".","_npmVersion":"2.0.0","_npmUser":{"name":"bruth","email":"b@devel.io"},"maintainers":[{"name":"bruth","email":"b@devel.io"}],"dist":{"shasum":"1666932c9a1c22427fab3e3db5c6fa278a6aa58d","tarball":"https://registry.npmjs.org/json-patch/-/json-patch-0.5.0.tgz","integrity":"sha512-dW8sb5N3b+0aNzkmCVqR4IxXPcO1+0jVCTbUM85KStaEbJzFyh/mW36Y+8oWkyX1E8q4aEBm8F0hN89/bxzgJQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFJW1x2w2/+z7BoydECW7H9N7GYOxB97/taVY6kt5cOMAiEA2Z6hs4BWqqfQE8e2z+LsyDsLC0qSQLZEnDyVtCy0Tq8="}]}},"0.6.0":{"name":"json-patch","author":{"name":"Byron Ruth","email":"b@devel.io"},"version":"0.6.0","description":"A JavaScript implementation of the JSON Object Notation (JSON) Patch http://tools.ietf.org/html/rfc6902 and JSON Pointer http://tools.ietf.org/html/rfc6901 specifications.","license":"BSD","keywords":["diff","patch","json","jsonpatch","jsonpointer"],"main":"jsonpatch.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/bruth/jsonpatch-js.git"},"devDependencies":{"coffee-script":"^1.8.0"},"gitHead":"692c4d09af47008024cc5f3795dfd8cdd0eea1dc","bugs":{"url":"https://github.com/bruth/jsonpatch-js/issues"},"homepage":"https://github.com/bruth/jsonpatch-js#readme","_id":"json-patch@0.6.0","_shasum":"9e6740367ddab14aca5350311698e83923eafabb","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.8.1","_npmUser":{"name":"bruth","email":"b@devel.io"},"dist":{"shasum":"9e6740367ddab14aca5350311698e83923eafabb","tarball":"https://registry.npmjs.org/json-patch/-/json-patch-0.6.0.tgz","integrity":"sha512-vzxb6dSGEw5LQspydLIUleDmgaBh15o4DIp5hYmLlib3P5vyNGolPvHvS1EwogO/nSeZ5wUUUk5ys2s1eZM7MQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBOmfpUMbxjjOEoXC/6aGTV8AD09Z48dt4jDk7PZfzqdAiAtCLIiVY006RUyYLyvY8GXjkRbCUyT8Juh38bIT108FA=="}]},"maintainers":[{"name":"bruth","email":"b@devel.io"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/json-patch-0.6.0.tgz_1476960553371_0.42494354071095586"}},"0.6.1":{"name":"json-patch","author":{"name":"Byron Ruth","email":"b@devel.io"},"version":"0.6.1","description":"A JavaScript implementation of the JSON Object Notation (JSON) Patch http://tools.ietf.org/html/rfc6902 and JSON Pointer http://tools.ietf.org/html/rfc6901 specifications.","license":"BSD","keywords":["diff","patch","json","jsonpatch","jsonpointer"],"main":"jsonpatch.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/bruth/jsonpatch-js.git"},"devDependencies":{"coffee-script":"^1.12.3"},"gitHead":"a64f42ee2354e27ee1951de1f8e1d566e5522abf","bugs":{"url":"https://github.com/bruth/jsonpatch-js/issues"},"homepage":"https://github.com/bruth/jsonpatch-js#readme","_id":"json-patch@0.6.1","_shasum":"1407e7091f99609871ad0a638a075afff48be307","_from":".","_npmVersion":"4.0.5","_nodeVersion":"7.4.0","_npmUser":{"name":"bruth","email":"b@devel.io"},"dist":{"shasum":"1407e7091f99609871ad0a638a075afff48be307","tarball":"https://registry.npmjs.org/json-patch/-/json-patch-0.6.1.tgz","integrity":"sha512-7nfQ8HIv/JRO5XiLCfNSP+iZqvxGNTlMl0gvMxz9mYA9XnhnT+shYapq579ywerhOWmdAI8iqTRq2AAmrr1jNg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICxrHPE6GrgnROLbSP7PcmoXWEqBDmfzmSynwOgoqileAiEAyBP7ZeMJmaIQCUXs7ig5Ocxc8vMtRZ2gY0WV3YA91K4="}]},"maintainers":[{"name":"bruth","email":"b@devel.io"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/json-patch-0.6.1.tgz_1485782538079_0.1703887574840337"}},"0.7.0":{"name":"json-patch","author":{"name":"Byron Ruth","email":"b@devel.io"},"version":"0.7.0","description":"A JavaScript implementation of the JSON Object Notation (JSON) Patch http://tools.ietf.org/html/rfc6902 and JSON Pointer http://tools.ietf.org/html/rfc6901 specifications.","license":"BSD","keywords":["diff","patch","json","jsonpatch","jsonpointer"],"main":"jsonpatch.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/bruth/jsonpatch-js.git"},"devDependencies":{"coffee-script":"^1.12.3"},"gitHead":"3dc98349454f821ab97ab88b5742043686c7b256","bugs":{"url":"https://github.com/bruth/jsonpatch-js/issues"},"homepage":"https://github.com/bruth/jsonpatch-js#readme","_id":"json-patch@0.7.0","_npmVersion":"5.3.0","_nodeVersion":"8.4.0","_npmUser":{"name":"bruth","email":"b@devel.io"},"dist":{"integrity":"sha512-9zaGTzsV6Hal5HVMC8kb4niXYQOOcq3tUp0P/GTw6HHZFPVwtCU2+mXE9q59MelL9uknALWnoKrUxnDpUX728g==","shasum":"2598958ea67fa3660dae8ee684d35407b37f4b98","tarball":"https://registry.npmjs.org/json-patch/-/json-patch-0.7.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID2MwPs3GoowZ6YKc36jArNdMUi05sf5PbwVqW8yi7lFAiEAxavnWNyGaLsOQN4hR2oGgs4d2aqjHA+9sGjkIstAOR0="}]},"maintainers":[{"name":"bruth","email":"b@devel.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/json-patch-0.7.0.tgz_1503337846195_0.18203770648688078"}}},"readme":"# jsonpatch-js\n\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/bruth/jsonpatch-js/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\n\nLibrary to apply JSON Patches in JavaScript\n\n- JSON Patch - http://tools.ietf.org/html/rfc6902\n- JSON Pointer - http://tools.ietf.org/html/rfc6901\n\njsonpatch-js works as in the browser as a script, as a Node module and as an\nAMD module.\n\n## Install\n\n**Bower**\n\n```\nbower install json-patch\n```\n\n**NPM**\n\n```\nnpm install json-patch\n```\n\n**Note: at this time, all operations are applied in-place.**\n\n## Methods\n\n**`jsonpatch.apply(document, patch)`**\n\nApplies a patch to the document\n\n**`jsonpatch.compile(patch)`**\n\nCompiles a patch and returns a function that takes a document to apply the patch to.\n\n## Patch Operations\n\n### Add\n\nPatch syntax: `{op: 'add', path: <path>, value: <value>}`\n\n```javascript\n// Add property, result: {foo: 'bar'}\njsonpatch.apply({}, [{op: 'add', path: '/foo', value: 'bar'}]);\n\n// Add array element, result: {foo: [1, 2, 3]}\njsonpatch.apply({foo: [1, 3]}, [{op: 'add', path: '/foo/1', value: 2}]);\n\n// Complex, result: {foo: [{bar: 'baz'}]}\njsonpatch.apply({foo: [{}]}, [{op: 'add', path: '/foo/0/bar', value: 'baz'}]);\n```\n\n### Remove\n\nPatch syntax: `{op: 'remove', path: <path>}`\n\n```javascript\n// Remove property, result: {}\njsonpatch.apply({foo: 'bar'}, [{op: 'remove', path: '/foo'}]);\n\n// Remove array element, result: {foo: [1, 3]}\njsonpatch.apply({foo: [1, 2, 3]}, [{op: 'remove', path: '/foo/1'}]);\n\n// Complex, result: {foo: [{}]}\njsonpatch.apply({foo: [{bar: 'baz'}]}, [{op: 'remove', path: '/foo/0/bar'}]);\n```\n\n### Replace\n\nPatch syntax: `{op: 'replace', path: <path>, value: <value>}`\n\n```javascript\n// Replace property, result: {foo: 1}\njsonpatch.apply({foo: 'bar'}, [{op: 'replace', path: '/foo', value: 1}]);\n\n// Replace array element, result: {foo: [1, 4, 3]}\njsonpatch.apply({foo: [1, 2, 3]}, [{op: 'replace', path: '/foo/1', value: 4}]);\n\n// Complex, result: {foo: [{bar: 1}]}\njsonpatch.apply({foo: [{bar: 'baz'}]}, [{op: 'replace', path: '/foo/0/bar', value: 1}]);\n```\n\n### Move\n\nPatch syntax: `{op: 'move', from: <path>, path: <path>}`\n\n```javascript\n// Move property, result {bar: [1, 2, 3]}\njsonpatch.apply({foo: [1, 2, 3]}, [{op: 'move', from: '/foo', path: '/bar'}]);\n```\n\n### Copy\n\nPatch syntax: `{op: 'copy', from: <path>, path: <path>}`\n\n```javascript\n// Copy property, result {foo: [1, 2, 3], bar: 2}\njsonpatch.apply({foo: [1, 2, 3]}, [{op: 'copy', from: '/foo/1', path: '/bar'}]);\n```\n\n### Test\n\nPatch syntax: `{op: 'test', path: <path>, value: <value>}`\n\n```javascript\n// Test equality of property to value, result: true\njsonpatch.apply({foo: 'bar'}, [{op: 'test', path: '/foo', value: 'bar'}]\n```\n\n*Changed in 0.5.0*\n\nThe return value is no longer a boolean, but now the the document itself which adheres correctly to the specification. It the test fails, a `PatchTestFailed` error will be thrown.\n\n## Error Types\n\n**`JSONPatchError`**\n\nBase error type which all patch errors extend from.\n\n**`InvalidPointerError`**\n\nThrown when the pointer is invalid.\n\n**`InvalidPatchError`**\n\nThrown when the patch itself has an invalid syntax.\n\n**`PatchConflictError`**\n\nThrown when there is a conflic with applying the patch to the document.\n\n**`PatchTestFailed`**\n\nThrown when a test operation is applied and fails.\n","maintainers":[{"name":"bruth","email":"b@devel.io"}],"time":{"modified":"2022-06-19T06:20:38.411Z","created":"2012-12-02T12:44:47.218Z","0.2.3":"2012-12-02T12:44:48.076Z","0.3.0":"2012-12-02T18:09:23.480Z","0.4.0":"2013-04-29T04:35:06.780Z","0.4.1":"2014-02-03T11:53:46.881Z","0.4.2":"2014-06-22T09:49:12.833Z","0.4.3":"2014-06-22T10:18:13.593Z","0.5.0":"2014-09-24T00:31:23.888Z","0.6.0":"2016-10-20T10:49:14.161Z","0.6.1":"2017-01-30T13:22:19.744Z","0.7.0":"2017-08-21T17:50:47.140Z"},"author":{"name":"Byron Ruth","email":"b@devel.io"},"repository":{"type":"git","url":"git://github.com/bruth/jsonpatch-js.git"},"readmeFilename":"README.md","homepage":"https://github.com/bruth/jsonpatch-js#readme","keywords":["diff","patch","json","jsonpatch","jsonpointer"],"bugs":{"url":"https://github.com/bruth/jsonpatch-js/issues"},"license":"BSD","users":{"passcod":true,"burl.bn":true,"sopov":true,"cwagner":true}}