{"name":"just-diff-apply","version":"5.0.1","description":"Apply a diff to an object. Optionally supports jsonPatch protocol","main":"index.js","module":"index.mjs","exports":{".":{"require":"./index.js","default":"./index.mjs"}},"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":"117c89ea58707f3baa9690973c95694db643db27","homepage":"https://github.com/angus-c/just#readme","_id":"just-diff-apply@5.0.1","_nodeVersion":"12.22.6","_npmVersion":"8.1.3","dist":{"integrity":"sha512-6/6ak2DFVokPxg6RnOAb15nCak3BdXH14B0qsO0ZYBxCbBYypZG/Fhc/r2p8hiMeYcbIzmlruVdcxStWgm1RuA==","shasum":"7a538a8701942d065a855e4292dae8fafedf9a07","tarball":"http://registry-npm.ywwl.com/just-diff-apply/download/just-diff-apply-5.0.1.tgz","fileCount":7,"unpackedSize":10307,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2k1tCRA9TVsSAnZWagAA1zwP/1+piyJm9GqBoOaxX1hX\nt0+2uaH2Bx5Q0Bs07DbbllmbsUwM6+bV8c58uPbnxwoQ5G/rhCnlCJIRqwgr\nUOpvMPQYhFM756Nf76UVch7+NfmVNwIcNZQLjBrHUY4R8nS5D1/hrVsr6JUR\nDbSf2chYUMYpdvoj6OLTFKBzYr9Lr2PqqYH4e1VhQjUXR/VXPwMTcGBnEaDi\nrlGOuoQPN2ATvcP1dOtauoDwpQyozMZ58/smY4W+UorNmmUQk4PWPKnVGN3E\n+F2Dqc/ddV3X6QBWKuXfw6bXiGSSi90dAhmi2dgZrw7kx9hH6rAGAu+u1Q7m\nhAwxhpg23WEcdjuwQ64BCdV0fij5mvcbIm/zcPL4QjSdBfy4FkD6WIzvZGvK\n1GcscPJ95OxFe9BKTjK/FjUNz5TUmLVlNANj0orguYbduU3HeQWf5K8Odmj/\nhZh0Wbsnpd2KndevoXNiIfcZuiQUdiVjlu9VBoYM+biI4GeLz3lR3A8mAV3k\nTWmy9QhusDU4S11sxSsCmJyET6LhMABNJ/zNDIjLcReQOPB4ZLgOaMf6D91I\nCEdZE2zPFO4uGweFpdq+SyIhQe0/n/ubzC1tLBsiec14ykjvraLlDWB3Dd/T\nt9rUL3IkCMuYJqK8PmsTVd14yQJ164yGvbQ2ge2lsNnkECI9IVawMAtrbwTM\n3/Zj\r\n=I6hZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCXOizsPXPWf3M8ZW61Bm0OAvwUG1uM7XtV3XFrORP/BgIgYqNZPgFZTI2r2XjtyDzo2S9ZNoCjYw1NlREOqQeTDGI="}],"size":2812,"noattachment":false,"key":"/just-diff-apply/-/just-diff-apply-5.0.1.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.0.1_1641696621258_0.5017361388282109"},"_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":1641696621382,"_cnpm_publish_time":1641696621382,"dist-tags":{"latest":"5.5.0"}}