{"name":"just-diff-apply","version":"2.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@2.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.6.0","_npmUser":{"name":"angus-c","email":"anguscroll@gmail.com"},"dist":{"integrity":"sha512-nFRg6HV3uj9Gh4hXpgldz4DT6sS6fF1scU3jpJ0XMyZ6W4fj0xoH9wYcMmfBnIA6sGXfHkyXHlgV80DSdT/jZQ==","shasum":"85687a35f406cad0c67de83645faec621ab9e54e","tarball":"http://registry-npm.ywwl.com/just-diff-apply/download/just-diff-apply-2.0.0.tgz","fileCount":4,"unpackedSize":6035,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcZk78CRA9TVsSAnZWagAAQd4P/2JNQXm7W/go8lZ3XArh\nGDwkmEs+Q8qi/rr9DveG978/G8AUpKo5NXlGGdrcKgNEamJU3yS/QRQrV8Kc\njvol8dip1x67Y0ld2z4Ojc1tFB28Xj910n+//0Yh/cWOn5I8bVGTUBn5/LMo\nepRSPQC8KKCY9wvMRBecTSflHBNmPTRmfhYGx51CsufyopDqdcRdaxihH0qs\n9/nlTNdvS9S2VW9pthfiL/1KHUdC97tMZbVK1NNI4DR2y3/PwFK3ztHFk6SM\nCCJevIjMhX789ONv/JCJ+e1Uz6HdhSSygSojjzpLBF3nLV04xlqcXh/XRXdR\nrNNNvabToCnvxkl4/+mSqUTI8Y4+Q8+dYl1VhgSTuBnZ13YazcxjYcGVSJJ/\nYv9jKVYvao3W7YHSeHEko5wo+Zb5vHxyJ7Ar95azVDbMZeGvYAhRHcWwSoiG\n65Bnxekue83F+AXXSTqbP1IX46KlZZdaOiU0o5QBn2+CwzrR3P3kN5ZzbAdG\nynhu1X+35iTpZFYsq5qrAeKftTJIQS/2rhxH6L7fzGq2zS09wRci9UfOh6Zd\n2ZZ2axRVEu2xcJeH1nIPTtW7piz/Jp1jgy9qobkzx6Is3VCf8Qh2A9k4enoc\n92Opgi3Ww3jZ1vU7DkmJ/u9+YEOye9VAaGk3b9Rr7AKZF1KcI8bWv2DT1FLs\nHpQs\r\n=L2hT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1qqbsBJEsOu7wKSRjAhbi7YY3w5Z6t6nK/Qm0VoyNEwIhAPqHBJwjb/BDgL2ZM79f7dzaD9e7f+qmK9SzaQKV4qB5"}],"size":2264,"noattachment":false,"key":"/just-diff-apply/-/just-diff-apply-2.0.0.tgz"},"maintainers":[{"name":"angus-c","email":"anguscroll@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/just-diff-apply_2.0.0_1550208763714_0.9049478281983758"},"_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":1550208763870,"_cnpm_publish_time":1550208763870,"dist-tags":{"latest":"5.5.0"}}