{"name":"just-diff","version":"2.2.0","description":"Return an object representing the diffs between two objects. Supports jsonPatch protocol","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"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@2.2.0","_npmVersion":"5.5.1","_nodeVersion":"8.6.0","_npmUser":{"name":"angus-c","email":"anguscroll@gmail.com"},"dist":{"integrity":"sha512-5RmiA9chRs+xr9txMGSMcDCDYiBfjfqr8PpeT+3RJmozx9YU9XDKFKksL5ZFTJr5uctsyLABQuKt6C4jJGWTlA==","shasum":"bed1883decc22c339ecc6634f17df91e827b5cf4","tarball":"http://registry-npm.ywwl.com/just-diff/download/just-diff-2.2.0.tgz","fileCount":4,"unpackedSize":7043,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJba8dmCRA9TVsSAnZWagAA1OYP/2B7/Ws+zz00J1UtYPfs\nbi/Orvki+AhvfnE7F4ZY3XGQgmOucSiOnO+rhRgpph1k3Gx+9/SuoRvQQKQN\nOQ8MkhV0+eoPfcvNHvUPSKLaIfb6o8q2TMST6cnsbplm6YWS8h5JNOajkYB0\ns9X+vlbURG/Xg0xbspyEJna8FDObfXfhjmlf31wMAbFVlnEoyC1/gCR3IvDV\ncQG7gRnfjT17G/S3e/oRajLxzxKKOaD54rKfazK5t/glle8LuDox8iUUGHa2\nlGQny95+cM8hIsuVhYs9/iluMJX0vnnfimtkBiBaEwKrjNmVvoWhqsE0Vg4/\nWkptImo2ISFN5vW2sNFc/iYeHeCnANoWyefzPJj0JJ9w7pFjVx57w0Gt1Wh/\nUdIXnwTZteQ4m74Dn6W3UdYGhdNhs0Ig4rzaNF9W/0dHZs8GQnGpxxppSqCH\nF39Y2hwaJg1xW21Kk+RMqUbxy05d4Xnxc0arUWOYjj750pqZaD4UhtQeowtz\nf1/M9VaB9t6yhi+IhHQJNUkJmqOVbxf1JlUHg68CvvMCbKc2wuW9DzGHrVFG\nx+WaKckAJiuy2roj8Hv0vYCFCkp4BnJ2qYoD6cwqXgZc4TGn3q2HUyUysqGw\npV04cuoJDM2/at1tTTKQJY70iplto7CQG/EB3cy88tkQLPhfTc2d6jfyHp5j\np7GB\r\n=Hbzq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAJ6EqH3GwIr93jkfi/+9w21ZNO+miMr1jA1PhTOebdaAiA38HvnH/GzKyM4oR+OPFsSat0iWjOfKyJ2w4TYnjJtWg=="}],"size":2442,"noattachment":false,"key":"/just-diff/-/just-diff-2.2.0.tgz"},"maintainers":[{"name":"angus-c","email":"anguscroll@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/just-diff_2.2.0_1533790054244_0.6017296981592972"},"_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":1533790054351,"_cnpm_publish_time":1533790054351,"dist-tags":{"latest":"6.0.2"}}