{"name":"just-diff","version":"5.0.1","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"},"homepage":"https://github.com/angus-c/just#readme","_id":"just-diff@5.0.1","_nodeVersion":"12.22.6","_npmVersion":"6.14.15","_npmUser":{"name":"angus-c","email":"anguscroll@gmail.com"},"dist":{"integrity":"sha512-X00TokkRIDotUIf3EV4xUm6ELc/IkqhS/vPSHdWnsM5y0HoNMfEqrazizI7g78lpHvnRSRt/PFfKtRqJCOGIuQ==","shasum":"db8fe1cfeea1156f2374bfb289826dca28e7e390","tarball":"http://registry-npm.ywwl.com/just-diff/download/just-diff-5.0.1.tgz","fileCount":8,"unpackedSize":13405,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2w36CRA9TVsSAnZWagAAFxoQAJC2He2Wv10e5T8ypb0F\nQ623Dh4VBqGeFeq/mwn+4gNgW7FcAem4YR/gCS+zE/tAwouyMGl5qR1ew8Lo\nKBcHIjtwuGz94rUOMAIttx8dY+6qVapC80uFofEatMMrIjOuStMyAc5pN2CJ\nzXUAAcT+AaDTFEJNlqnfu1BsGzFUZDSZKCv9ffoO0YyPqNljjpl+dTU9zqRy\nu9TjVQXLFjQ95qgzmkyHI0jIG4siQ7PxFcJ8s24Blc0Eed+O2D4djxIi0Kh8\naIgeQPNrBf4b8qgU6BsXeq9J3eGQ5PKOh1tvJ1DZEu37jWeNZ2rgvUKtKamg\n10HxiAaYrdW1APGQx4SjKorvRfnkhP7b3buQB+Fh4WFZEeQ+sIdZkjN47YF0\nrvym10/j0qtiPS54T43ektN8RMsjxAuvxeUaqEf16emOFTl6/PjLTXBU0zPc\n+N2FACdjsTi9wzodJTPAz59eE9xYa+qjldbpTG5xbF7/WXYob19JoktfIXF6\nQWAo5KE/h1iUcKJb+fDyXPkkW9bycrhoSr42sKH583o3VgTwNgI2BwiCOsk7\n48yuQsyPflZ+Dazr2AF8PUpWgagJkgo2RbJ3QiK+Y49cSjDc/ulOqBkAGRWB\ngT0dFQwox8sYQIemkd0wWXupzPRRCwV2wUt+NPuGUb6nomCeHpFPDMTDTedT\niKcu\r\n=ywP4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCtDp85G0utJsqQG4+KbbXMIY0NMZPV8Ycu6VrFN4nKbQIgAfKIFLi6JqotQp6o38IosDB2rkm4Wvq+9CBge2nJw28="}],"size":3251,"noattachment":false,"key":"/just-diff/-/just-diff-5.0.1.tgz"},"directories":{},"maintainers":[{"name":"angus-c","email":"anguscroll@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/just-diff_5.0.1_1636787999281_0.8360872399836479"},"_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":1636787999406,"_cnpm_publish_time":1636787999406,"dist-tags":{"latest":"6.0.2"}}