{"name":"just-diff","version":"5.0.3","description":"Return an object representing the diffs between two objects. Supports jsonPatch protocol","main":"index.js","module":"index.mjs","exports":{".":{"require":"./index.js","default":"./index.mjs"}},"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","jsonPatch","no-dependencies","just"],"author":{"name":"Angus Croll"},"license":"MIT","bugs":{"url":"https://github.com/angus-c/just/issues"},"gitHead":"b93fcf2ccf5671453f33b26c6bd5c752f46f6ca8","homepage":"https://github.com/angus-c/just#readme","_id":"just-diff@5.0.3","_nodeVersion":"12.22.6","_npmVersion":"8.1.3","dist":{"integrity":"sha512-a8p80xcpJ6sdurk5PxDKb4mav9MeKjA3zFKZpCWBIfvg8mznfnmb13MKZvlrwJ+Lhis0wM3uGAzE0ArhFHvIcg==","shasum":"4c9c514dec5526b25ab977590e3c39a0cf271554","tarball":"http://registry-npm.ywwl.com/just-diff/download/just-diff-5.0.3.tgz","fileCount":9,"unpackedSize":13842,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID43/PVXEURYDRprQqO7C3Kk6xeEOB7408djFl/uySLrAiB/y4I+iASGYBEmxm9s+J4+lhAObGbSi+jAnOK0gIT50g=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJim/bWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqTSQ/+JC/ZL1zzYPa6bOJ/bZt7w3ibfwBoqeTTitCIg5EaH91FLxRw\r\n/bLXrulO9GuCRn3r5jaeVCj8Ot1I7ffmD8HH9S1WHeR4ZWsIpKEggiZyfP6+\r\nY+nz/zLYMsyaVVhNxOQr8ApJP/WQxdluJJb8P6xFr23ORkDO4oZ95NVzOhpg\r\naSwMUQNi91Lqe3KElEuS5llhpf5enKW33hAGL4YAcWKCKakkbJBkdbKTd/VI\r\nBQViwr7T8NSgr7upTd/IdIvSWXJayr97RkL+qW3yq0TB4Rei2kjEu/OGA7Dz\r\n1MCLWryPQBVrD+2Ju2sxIqA5Hdgyal/fd45OHsgFKuLx4eco7w5YBVNeMPQt\r\nPlXJtox9x/LH6OVFCbx1Sx4cWpWYixdr84NQ5Ya9qP1d+Z44SukiVdw2BO8q\r\nkfFyymp2BvWYDMrarDFS/xeSUTUsGDoH69h+W6nzVu1tAyaxypjHTJAkbID/\r\nK5Rir4K3VwphfqW7/+ax5ENiGHVf+AXDVwomW3IOuNrEuOYYI81ywuNwb2F1\r\n2MhgnYXE8wOumDohBs3U9lQpmwc2VKVq8f3xM+FO4ZgeaTivWgZCpt9bNK33\r\nnbhsRumeoqDMdopPnG5Yw0SyAIZutWnjkCVNlZVj5SvW7mgSp3G+tgtyazIc\r\nBfffiVkSqrImUTo3GJHozOXUkfzZ6eCgwwg=\r\n=v5Ik\r\n-----END PGP SIGNATURE-----\r\n","size":3448,"noattachment":false,"key":"/just-diff/-/just-diff-5.0.3.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_5.0.3_1654388438323_0.5897833906858478"},"_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\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)\n\n```shell\nnpm install just-diff\n```\n```shell\nyarn add just-diff\n```\n\nReturn an object representing the difference between two other objects\nPass converter to format as http://jsonpatch.com\n\n```js\nimport {diff} from 'just-diff';\n\nconst obj1 = {a: 4, b: 5};\nconst obj2 = {a: 3, b: 5};\nconst obj3 = {a: 4, c: 5};\n\ndiff(obj1, obj2);\n[\n  { \"op\": \"replace\", \"path\": ['a'], \"value\": 3 }\n]\n\ndiff(obj2, obj3);\n[\n  { \"op\": \"remove\", \"path\": ['b'] },\n  { \"op\": \"replace\", \"path\": ['a'], \"value\": 4 }\n  { \"op\": \"add\", \"path\": ['c'], \"value\": 5 }\n]\n\n// using converter to generate jsPatch standard paths\nimport {diff, jsonPatchPathConverter} from 'just-diff'\ndiff(obj1, obj2, jsonPatchPathConverter);\n[\n  { \"op\": \"replace\", \"path\": '/a', \"value\": 3 }\n]\n\ndiff(obj2, obj3, jsonPatchPathConverter);\n[\n  { \"op\": \"remove\", \"path\": '/b' },\n  { \"op\": \"replace\", \"path\": '/a', \"value\": 4 }\n  { \"op\": \"add\", \"path\": '/c', \"value\": 5 }\n]\n\n// arrays\nconst obj4 = {a: 4, b: [1, 2, 3]};\nconst obj5 = {a: 3, b: [1, 2, 4]};\nconst obj6 = {a: 3, b: [1, 2, 4, 5]};\n\ndiff(obj4, obj5);\n[\n  { \"op\": \"replace\", \"path\": ['a'], \"value\": 3 }\n  { \"op\": \"replace\", \"path\": ['b', 2], \"value\": 4 }\n]\n\ndiff(obj5, obj6);\n[\n  { \"op\": \"add\", \"path\": ['b', 3], \"value\": 5 }\n]\n\n// nested paths\nconst obj7 = {a: 4, b: {c: 3}};\nconst obj8 = {a: 4, b: {c: 4}};\nconst obj9 = {a: 5, b: {d: 4}};\n\ndiff(obj7, obj8);\n[\n  { \"op\": \"replace\", \"path\": ['b', 'c'], \"value\": 4 }\n]\n\ndiff(obj8, obj9);\n[\n  { \"op\": \"replace\", \"path\": ['a'], \"value\": 5 }\n  { \"op\": \"remove\", \"path\": ['b', 'c']}\n  { \"op\": \"add\", \"path\": ['b', 'd'], \"value\": 4 }\n]\n```\n","publish_time":1654388438545,"_cnpm_publish_time":1654388438545,"dist-tags":{"latest":"6.0.2"}}