{"name":"just-diff","version":"6.0.2","description":"Return an object representing the diffs between two objects. Supports jsonPatch protocol","type":"module","exports":{".":{"types":"./index.d.ts","require":"./index.cjs","import":"./index.mjs"},"./package.json":"./package.json"},"main":"index.cjs","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":"6417f865dbdc5370d1007d7c5243f5fc6db33636","homepage":"https://github.com/angus-c/just#readme","_id":"just-diff@6.0.2","_nodeVersion":"12.22.6","_npmVersion":"8.1.3","dist":{"integrity":"sha512-S59eriX5u3/QhMNq3v/gm8Kd0w8OS6Tz2FS1NG4blv+z0MuQcBRJyFWjdovM0Rad4/P4aUPFtnkNjMjyMlMSYA==","shasum":"03b65908543ac0521caf6d8eb85035f7d27ea285","tarball":"http://registry-npm.ywwl.com/just-diff/download/just-diff-6.0.2.tgz","fileCount":9,"unpackedSize":18674,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD0qpuq4MY3c4IPQjHBOzj3iXlQLeNOJb+IT7dUA1Iy/wIhAOvTJ3aezSW2v1iRZbNz/23F0N7Z8DsdFiQfqjmyzIZy"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkH5j4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqQzg/9FlMCpg0JB15xw6ho0PYIH017sEs6itRhXm9uNyaJndKQZIHs\r\nyAjL8XheRgqUW4T6W20n60D8BoXUgSOgEmUM1k5v0rRH7my06+cDGhD0GyjH\r\nZepbKy2xNWxs6pfHJxr0RUE4VpzXsaIosXKtcjJ8uXsogA3jHsL/ZB6+jlWL\r\nJSIjprbA2kIDtnAgkMkv8KhNY5vbecyOD/b24DapCnnuke/5OqgpIWpAg4Pe\r\nszsRbMczA1ufkcMOAYxDM9NLzHjDxHuCw0OoL2O3YR2ebHky01r/rZreOUt/\r\nY4/6IZ5sSw8uhknZeZ8fHQ9+MIPUf4Hz747C4wBzPlvJzFdt/mZp1GDKqSh/\r\nhsB1UNJ003/XLL3cPl5ObQyV5HC+BwAdzYXXfSf7dQm68zGXT8csBkFJTDr7\r\nF9JfxLpJcD+95JNIgYBiYN0cDQRz9VK+LdPbMiYR2FqgrvWPSFJ49iDvZHcn\r\nkyUSBgOR3TWUFZVK/MisoNw3UyzlY7FFD2CDlOmGOJ0DoCMNjtMWybljeu3Y\r\n5Vn21eLNT5nap4W8GS1DoHI/pmxP3wtGbg6H/YIn/NvFmOtgkF3H0eiEfDNJ\r\nYgT+s5HKgoTyKOLQ0PXHlaBwRrEbqJWkznnXBJ5fq4uvY5WxwPwOTyTSSZsX\r\ntpBZNA3Q89UKRDm3XBf/rtDVdTgD5bGD37g=\r\n=0MfN\r\n-----END PGP SIGNATURE-----\r\n","size":4353,"noattachment":false,"key":"/just-diff/-/just-diff-6.0.2.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_6.0.2_1679792376383_0.7627252556013944"},"_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":1679792376579,"_cnpm_publish_time":1679792376579,"dist-tags":{"latest":"6.0.2"}}