{"name":"just-diff","version":"5.1.1","description":"Return an object representing the diffs between two objects. 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","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@5.1.1","_nodeVersion":"16.3.0","_npmVersion":"7.15.1","dist":{"integrity":"sha512-u8HXJ3HlNrTzY7zrYYKjNEfBlyjqhdBkoyTVdjtn7p02RJD5NvR8rIClzeGA7t+UYP1/7eAkWNLU0+P3QrEqKQ==","shasum":"8da6414342a5ed6d02ccd64f5586cbbed3146202","tarball":"http://registry-npm.ywwl.com/just-diff/download/just-diff-5.1.1.tgz","fileCount":9,"unpackedSize":14064,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAtieQFDfDp6S1heZKz5/+8hiWCYs1n6nJfyPNZFqw1hAiAf87hkPJjkBD9Yzsi/8hyFF/1a5p44XoBTZ6pXKfAYMQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi8UulACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpwMA//RUIxi5ZxrmuDIAKksrtasWqQHEBg1Ukbj7WQX3n8fyQEQg0c\r\nW2Uy2ViNqDxW30XKaOvnaa1AAd8Cwh/Q2kxkr/kmTYkz4lK5CPhIIV+JEYIu\r\npKPs4ffj0h8A9E+8hA3z0EscSHvhEhFRMheC/LK1Joz+6HfdLU7vLWY0ERni\r\nzCrkTrqAdrwJ3/qUvfWD9jU9ME70/uQaN7NL2+yonJwEtt0sI0Sle6TxG2uZ\r\nzMN6geR/+BT1dDAFbPZ9sUs8ouYNTziYQDDpg6aoEod4OWhEFvxuRrPs/epx\r\n+kgO7ShG9dImwS5JsNlaY7oeypCghTgJlOCQLavg8pcb+xDJ2NzqF4Be1RDl\r\nIzT4ZVNS7A9DMIRu1T5G40xJpTYLd73QswON4qsFYinqRtwDAVm6F3g75zal\r\naeYy3xDZ4NmPErV09aFJjMGQ2o46GnfJZSS4R27ZCnoh5aIv/nZEdsXmkT6X\r\nmEuj3iWuqKJmMx0CfKY8J5RTg+BPiy1KJyMtBxOV32y6cHIQ4N6vdZMUV20S\r\nswpmsBxcH7epxhNkAUQk3fmHdlaASwy9ngLbxJD6u9A0zcjnzfD8E159bWfk\r\nRqXvpF0YvL34yzkyyz4NoBAUdZfDwxDKlqrU2nIBiqm310XJAC+nv6jVkShZ\r\n9x5wb0yyIoWNvjiUoOoIM4wNwDD/pK6jOPg=\r\n=1jgU\r\n-----END PGP SIGNATURE-----\r\n","size":3525,"noattachment":false,"key":"/just-diff/-/just-diff-5.1.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_5.1.1_1659980709170_0.43401494350419334"},"_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":1659980709337,"_cnpm_publish_time":1659980709337,"dist-tags":{"latest":"6.0.2"}}