{"name":"just-diff-apply","version":"3.0.0","description":"Apply a diff to an object. Optionally supports jsonPatch protocol","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/angus-c/just.git"},"keywords":["object","diff","apply","jsonPatch","no-dependencies","just"],"author":{"name":"Angus Croll"},"license":"MIT","bugs":{"url":"https://github.com/angus-c/just/issues"},"homepage":"https://github.com/angus-c/just#readme","_id":"just-diff-apply@3.0.0","_npmVersion":"5.10.0","_nodeVersion":"8.11.1","_npmUser":{"name":"angus-c","email":"anguscroll@gmail.com"},"dist":{"integrity":"sha512-K2MLc+ZC2DVxX4V61bIKPeMUUfj1YYZ3h0myhchDXOW1cKoPZMnjIoNCqv9bF2n5Oob1PFxuR2gVJxkxz4e58w==","shasum":"a77348d24f0694e378b57293dceb65bdf5a91c4f","tarball":"http://registry-npm.ywwl.com/just-diff-apply/download/just-diff-apply-3.0.0.tgz","fileCount":4,"unpackedSize":6075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdElHGCRA9TVsSAnZWagAAH0MP/jSIsW+yzoKI8VynW7w4\nlulc9dhmSM2ARq/IHytDtvIr+1P+dH2sOVb0MkYz5VfCPLA+LEavq4EhTSa2\ndfck94uAQV2fXuZ9+zobtJz62hBgL8xI3swILfjnRY06TXjsoKJxe/vkuFD8\neT5mSpl5R1AgARjb9YX3j5WZOOxYEm95SO1HNHXHcVAiu/j22OeFcgVizzTy\nxWFvtwB5+j8EOSEGEYW1jbdt4Zjufv61FGVwhWqACruS97aXZoj+QSKQvxQy\nYHxUReL+oifAVHgwsQ9fdlEAe8/aia84DoKPja5dqbYJNCjlUYpiCDg+NUdD\nFXLKtNjhALyOs2sT8TI+GGnEW7wFWs+GGlF3/iiNnP1KtqvAPN+X4ZomAV8y\nF9if7mleQk8kMZ8Gw5KUCGaWSguxkNbfbeqFBHcZYgP4VPsc1zwol44fBqqO\n57/0nST+CsEsBg5Moozg560x6N4XP59+5vuEiEyN9UwdwU7vbX2gzeEAds3Q\ntFLUTy4fAV9DF++07J0TkwNMv+44RnptboW0fLd1Q442kwYATQjmYm5bgoVN\noFSjL1GNaKuuSb+Ym9hlZwFr49DJBT0MSkMhnenXOzknBP5EA02Ih+u3xdUM\nXqud+QpJETN65u0AAQjUSSVaRaOoa5QvSBfWUUnEQKOiaVGfigIiqjwCbtXM\nI8cD\r\n=dB+d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDMHoWuKVMnICyFjEcOS/OOECKFXfI3o5f3Gs9a5AXM4AIhALLSSW3bf9l1tBQPzAF/Hdtpl5aLX6D4tbQxKRAEeVaT"}],"size":2283,"noattachment":false,"key":"/just-diff-apply/-/just-diff-apply-3.0.0.tgz"},"maintainers":[{"name":"angus-c","email":"anguscroll@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/just-diff-apply_3.0.0_1561481669512_0.33996909771874595"},"_hasShrinkwrap":false,"readme":"<!-- DO NOT EDIT THIS FILE! THIS FILE WAS AUTOGENERATED BY TEMPLATE-MATE -->\n<!-- SEE https://github.com/angus-c/just/blob/master/CONTRIBUTING.md#readme-template -->\n\n## just-diff-apply\n\nPart of a [library](https://anguscroll.com/just) of zero-dependency npm modules that do just do one thing.\nGuilt-free utilities for every occasion.\n\n[`🍦 Try it`](https://anguscroll.com/just/just-diff-apply)\n\n```shell\nnpm install just-diff-apply\n```\n```shell\nyarn add just-diff-apply\n```\n\nApply a diff object to an object. Pass converter to apply a http://jsonpatch.com standard patch\n\n```js\n  import {diffApply} from 'just-diff-apply';\n\n  const obj1 = {a: 3, b: 5};\n  diffApply(obj1,\n    [\n      { \"op\": \"remove\", \"path\": ['b'] },\n      { \"op\": \"replace\", \"path\": ['a'], \"value\": 4 },\n      { \"op\": \"add\", \"path\": ['c'], \"value\": 5 }\n    ]\n  );\n  obj1; // {a: 4, c: 5}\n\n  const obj2 = {a: 3, b: 5};\n  diffApply(obj2,\n    [\n      { \"op\": \"move\", \"from\": ['a'], \"path\": ['c']},\n    ]\n  );\n  obj2; // {b: 5, c: 3}\n\n  // using converter to apply jsPatch standard paths\n  // see http://jsonpatch.com\n  import {diffApply, jsonPatchPathConverter} from 'just-diff-apply'\n  const obj3 = {a: 3, b: 5};\n  diffApply(obj3, [\n    { \"op\": \"remove\", \"path\": '/b' },\n    { \"op\": \"replace\", \"path\": '/a', \"value\": 4 }\n    { \"op\": \"add\", \"path\": '/c', \"value\": 5 }\n  ], jsonPatchPathConverter);\n  obj3; // {a: 4, c: 5}\n\n  // arrays (array key can be string or numeric)\n  const obj4 = {a: 4, b: [1, 2, 3]};\n  diffApply(obj4, [\n    { \"op\": \"replace\", \"path\": ['a'], \"value\": 3 }\n    { \"op\": \"replace\", \"path\": ['b', 2], \"value\": 4 }\n    { \"op\": \"add\", \"path\": ['b', 3], \"value\": 9 }\n  ]);\n  obj4; // {a: 3, b: [1, 2, 4, 9]}\n\n  // nested paths\n  const obj5 = {a: 4, b: {c: 3}};\n  diffApply(obj5, [\n    { \"op\": \"replace\", \"path\": ['a'], \"value\": 5 }\n    { \"op\": \"remove\", \"path\": ['b', 'c']}\n    { \"op\": \"add\", \"path\": ['b', 'd'], \"value\": 4 }\n  ]);\n  obj5; // {a: 5, b: {d: 4}}\n```\n","publish_time":1561481669631,"_cnpm_publish_time":1561481669631,"dist-tags":{"latest":"5.5.0"}}