{"name":"just-diff-apply","version":"5.4.0","description":"Apply a diff to an object. Optionally supports jsonPatch protocol","main":"index.js","module":"index.mjs","exports":{".":{"require":"./index.js","default":"./index.mjs","types":"./index.d.ts"},"./package.json":"./package.json"},"types":"index.d.ts","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c"},"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"},"gitHead":"64f923f1695a29876930e5b6ab752b984c1531d2","homepage":"https://github.com/angus-c/just#readme","_id":"just-diff-apply@5.4.0","_nodeVersion":"12.22.6","_npmVersion":"8.1.3","dist":{"integrity":"sha512-nXI6VsJ3Z+9+qC4LYmxmvs40LY9VwYkACSCxD9lctd2nEtf+Jdf7lbkPuGycnu53gVoIACpPhOJ+8nZYRK9Gcw==","shasum":"c7698d80a19493e5a3d8dac0deaff499b565d6eb","tarball":"http://registry-npm.ywwl.com/just-diff-apply/download/just-diff-apply-5.4.0.tgz","fileCount":9,"unpackedSize":15562,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCL4ZQARyu2o1kF0yYy85tyqhkKyYR0nk/DrR6SOzgpPwIhAKIH2UZSP7dGz2tvRKW2Vn156RyLymeLfaGxjdafiRsv"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi8D6xACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqJZxAAg9XYhG1wJSHJkrIz655Ae6x2A72V9AGeyMmanStQPZr3h78x\r\nDXF8Z3jr3+lwbW0leCg2O0keCfjwLQGDNCmT3/OQ96OnG1BkzJPsToklh4dY\r\nwVdAGKPQ8ADprf/mKKOm0649zuxGT1T0sdTHA+4gy3DE0meLFGgWi8Pa2cxf\r\nuW/3yxp8NywAChKwqYWQ49mbRIlpDqAf7pylD1xMjfOlIbffB8iLOHoljUem\r\nbcx8ZIdXAJvmvrbTYvTpPoEVnLUmdQ4BmZdHBQQrQTAKK2NTkzoW9ozfTXCd\r\n5t7B6uvq2pOymyaDozIJ2J/ligyrDJDZo0azFCvqtFwTzfg0Oz9bGAfn2ona\r\nlPYhISe5a5Oh5puOA0xIfry1+4/6Bce4I9N2hWprHB8GYEibAG/vNM7K4lz/\r\nuCnqov2BVaYF+gYzyaiYAY8pqYfXzq7enMTXY5C30H3QIqvNk4q5yLDoe6Ce\r\nTZDGUBDldhxgPvZGI5VDWSlXxh4ZcI9NRnZz4pbpSmmjOEYEAYJjc04FQYlv\r\ngXGxNzIGCzoFheQaLa6wvJOBdT+kZnqXYbPn0FJ8Rpt4aqZmMlg3O/fJFI5I\r\n8hp6oHu3gjvBYM1/TnH9ljVsBlSyMr54H6pXMlOq7cfSkGCTixAGy4TzqTLg\r\nYcp0BESx+Lpk/aqYAhNq34B83HQx+TM3uVE=\r\n=3rFl\r\n-----END PGP SIGNATURE-----\r\n","size":3877,"noattachment":false,"key":"/just-diff-apply/-/just-diff-apply-5.4.0.tgz"},"_npmUser":{"name":"angus-c","email":"anguscroll@gmail.com"},"directories":{},"maintainers":[{"name":"angus-c","email":"anguscroll@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/just-diff-apply_5.4.0_1659911856803_0.7938094971472669"},"_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":1659911856983,"_cnpm_publish_time":1659911856983,"dist-tags":{"latest":"5.5.0"}}