{"name":"dlv","version":"1.1.3","description":"Safely get a dot-notated property within an object.","main":"dist/dlv.js","browser":"dist/dlv.umd.js","module":"dist/dlv.es.js","scripts":{"dev":"microbundle watch","build":"microbundle","prepublish":"npm run build","test":"node test","release":"npm run build && npm test && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish"},"keywords":["delve","dot notation","dot"],"author":{"name":"Jason Miller","email":"jason@developit.ca","url":"http://jasonformat.com"},"repository":{"type":"git","url":"git+https://github.com/developit/dlv.git"},"license":"MIT","devDependencies":{"microbundle":"^0.11.0"},"gitHead":"e636db817a96e4ca4710b407163fb992748b3b80","bugs":{"url":"https://github.com/developit/dlv/issues"},"homepage":"https://github.com/developit/dlv#readme","_id":"dlv@1.1.3","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"developit","email":"jason@developit.ca"},"dist":{"integrity":"sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==","shasum":"5c198a8a11453596e751494d49874bc7732f2e79","tarball":"http://registry-npm.ywwl.com/dlv/download/dlv-1.1.3.tgz","fileCount":9,"unpackedSize":5802,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc5UsfCRA9TVsSAnZWagAArEMP/A5e6b9uwg27f4djhXDm\nMElDlGhS5IayiNzWleFfR0OdR7twgvzy07iqKMOXlOpi8twnig7dvpLtgQbW\n5G2dRnS5CT+BW4VMrkUgxl4BOOhMEQoU/Jskp1/EK7TP2NdZuKt5IWCRnpBg\ne4xNnkcax04G9PcVbcRVH/booVL3RafrlkSKHqRuiUCu9DUiTODo5U1/KkSA\n/kfcBSeBY8YCyBMkRC/vX9W0AFW+9CRVmT1Mw7jf2RId5KOoQ0LaVYV7E9o2\n3WBfgq/dw5+HVqUZxYHsA6yI5J1kfKr+zMMc/izgwBALVbYsvn4gHdlKsgaU\nqWvMCzqKmXyXLFGu6Xkrd18ctRjSJDSXulNEMVHfXWMA2aUaiRJtqXMlexKT\nis+5XQSr2FfgT44qOSIBgT7pjRW/j+5VTiZfP/RuM8LLJgdvJjZzl3HrxQiC\ngmg9tZiBCEJj4N4/prFVs2yomd3atqkPZ73iFS6DSxHC46YGnu8A3o5jGgPM\nprUESpYeRg9I9fnE5U0N56VDsBzgt04I+xOsOGy5Q1zo8CZCYhi5WWk90o2P\nYrdEufpdQNjpjbob38PXfpk5KUpL3fH3gnLqeeOwVra1F+lxljT2YktSmG8+\nHluYElq8do0SC2MmSi2ObWhpmAyaBk/UnSBNvZ/0TWQAEA5KDmE2taEWiWPH\n2uQf\r\n=oMCz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDfGq8XT9onC48GeK9SJS/JYP/Lm7Icy3FHOx7Ewx0iyAIgEUVeonbj9sQ4rg7CC1Rb66ANvGPv7kUw/H9AHvoEhME="}],"size":2160,"noattachment":false,"key":"/dlv/-/dlv-1.1.3.tgz"},"maintainers":[{"name":"developit","email":"jason@developit.ca"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dlv_1.1.3_1558530846846_0.17059745612482824"},"_hasShrinkwrap":false,"readme":"# `dlv(obj, keypath)` [![NPM](https://img.shields.io/npm/v/dlv.svg)](https://npmjs.com/package/dlv) [![Build](https://travis-ci.org/developit/dlv.svg?branch=master)](https://travis-ci.org/developit/dlv)\n\n> Safely get a dot-notated path within a nested object, with ability to return a default if the full key path does not exist or the value is undefined\n\n\n### Why?\n\nSmallest possible implementation: only **130 bytes.**\n\nYou could write this yourself, but then you'd have to write [tests].\n\nSupports ES Modules, CommonJS and globals.\n\n\n### Installation\n\n`npm install --save dlv`\n\n\n### Usage\n\n`delve(object, keypath, [default])`\n\n```js\nimport delve from 'dlv';\n\nlet obj = {\n\ta: {\n\t\tb: {\n\t\t\tc: 1,\n\t\t\td: undefined,\n\t\t\te: null\n\t\t}\n\t}\n};\n\n//use string dot notation for keys\ndelve(obj, 'a.b.c') === 1;\n\n//or use an array key\ndelve(obj, ['a', 'b', 'c']) === 1;\n\ndelve(obj, 'a.b') === obj.a.b;\n\n//returns undefined if the full key path does not exist and no default is specified\ndelve(obj, 'a.b.f') === undefined;\n\n//optional third parameter for default if the full key in path is missing\ndelve(obj, 'a.b.f', 'foo') === 'foo';\n\n//or if the key exists but the value is undefined\ndelve(obj, 'a.b.d', 'foo') === 'foo';\n\n//Non-truthy defined values are still returned if they exist at the full keypath\ndelve(obj, 'a.b.e', 'foo') === null;\n\n//undefined obj or key returns undefined, unless a default is supplied\ndelve(undefined, 'a.b.c') === undefined;\ndelve(undefined, 'a.b.c', 'foo') === 'foo';\ndelve(obj, undefined, 'foo') === 'foo';\n```\n\n\n### Setter Counterparts\n\n- [dset](https://github.com/lukeed/dset) by [@lukeed](https://github.com/lukeed) is the spiritual \"set\" counterpart of `dlv` and very fast.\n- [bury](https://github.com/kalmbach/bury) by [@kalmbach](https://github.com/kalmbach) does the opposite of `dlv` and is implemented in a very similar manner.\n\n\n### License\n\n[MIT](https://oss.ninja/mit/developit/)\n\n\n[preact]: https://github.com/developit/preact\n[tests]: https://github.com/developit/dlv/blob/master/test.js\n","publish_time":1558530846959,"_cnpm_publish_time":1558530846959,"dist-tags":{"latest":"1.1.3"}}