{"name":"just-diff-apply","version":"5.4.1","description":"Apply a diff to an object. Optionally supports jsonPatch protocol","main":"index.js","module":"index.mjs","exports":{".":{"require":"./index.js","types":"./index.d.ts","default":"./index.mjs"},"./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"},"homepage":"https://github.com/angus-c/just#readme","_id":"just-diff-apply@5.4.1","_nodeVersion":"16.3.0","_npmVersion":"7.15.1","dist":{"integrity":"sha512-AAV5Jw7tsniWwih8Ly3fXxEZ06y+6p5TwQMsw0dzZ/wPKilzyDgdAnL0Ug4NNIquPUOh1vfFWEHbmXUqM5+o8g==","shasum":"1debed059ad009863b4db0e8d8f333d743cdd83b","tarball":"http://registry-npm.ywwl.com/just-diff-apply/download/just-diff-apply-5.4.1.tgz","fileCount":9,"unpackedSize":15640,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEgOiIacuZUA9ArSiDCfPmaNz9YU2dAlfv+ZKles6wLLAiEAx1Ry2gtQ7HBUeTAW3XrmW7HxrwNsL2Y4k2CWJuBVbeA="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi8UucACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqpWQ/+LlY6vqTZ2BdSg/GutQtS/onv0VMDZIeo71AJ4bxasEuMPJAW\r\nQH+bctvXrB7ExJOAnflHpGHqAtS7oNmm8NqHHrpXoW2SA1UfMngBgJEEh7jp\r\nnFzqwp9aHF2cUgEu/8A+bYFug9umhwpGMc/jo2qJD2uU8yY3xlFah0fDIKRV\r\nLEg63esrxNLI3hmqRMM172jtMC9F+q7kwC5zsS1ETNSET+1+8MRz34YeXQI8\r\nQllxhhmbiTo1uKVzxLSQpavEG22zb3YNMMpLw6AvozlovKoaYWop/gEmz/G6\r\npQKR2PYYiYRi6vfTPdz7hkjmfJl8HwQNMjNx9aXiEIQVMihCmLaifSg/QCWc\r\nt7JVjOCaAIfU2o1dtSsodexO7pTlpOReQNnVpGni2jjnZCMsSr3VbCEgfsLK\r\nr6LBp2c5YrURhSPYhtVPnH39fo458YvSzPohqcQMSBUOniyRNqO8gtPmo+B4\r\ngSgD2vMW5n4hKAHTMRLNzagYLQErmzaLujMWKCa0Gun6urCFGvTAbQYtV/eI\r\nKziWBFhCAEuC7+6/MdfIjZgP7C/5HS5m0r1KE9CRRRIwYG2ltAPzJxYbYx8k\r\nKGOosgVtQ+qDi+KwZuCgkprg4VGV+ynpWN8s1O4VAmd7KdT4HTOqPLyZjugg\r\n/vyX9RCfElnl6atE+LjhLDdwsUzNQBpej/E=\r\n=rPBX\r\n-----END PGP SIGNATURE-----\r\n","size":3905,"noattachment":false,"key":"/just-diff-apply/-/just-diff-apply-5.4.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.4.1_1659980699793_0.698262386393937"},"_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":1659980699989,"_cnpm_publish_time":1659980699989,"dist-tags":{"latest":"5.5.0"}}