{"name":"dottie","version":"2.0.7","author":{"name":"Mick Hansen","email":"maker@mhansen.io"},"license":"MIT","_id":"dottie@2.0.7","maintainers":[{"name":"mickhansen","email":"mick.kasper.hansen@gmail.com"}],"homepage":"https://github.com/mickhansen/dottie.js#readme","bugs":{"url":"https://github.com/mickhansen/dottie.js/issues"},"dist":{"shasum":"fd1b465a1211b35d5660e95b69bb6d5b5809b3c4","tarball":"http://registry-npm.ywwl.com/dottie/download/dottie-2.0.7.tgz","fileCount":4,"integrity":"sha512-7lAK2A0b3zZr3UC5aE69CPdCFR4RHW1o2Dr74TqFykxkUCBXSRJum/yPc7g8zRHJqWKomPLHwFLLoUnn8PXXRg==","signatures":[{"sig":"MEUCIG98bRWPJf2339J5HPyF/ABTaS7mTSYKDEhpF+VyDmX4AiEAz/KTDxXT3hSTM7H1HTflAb35fbeHgOU4MbWLbIWxwDY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":10882,"size":4063,"noattachment":false,"key":"/dottie/-/dottie-2.0.7.tgz"},"main":"dottie.js","gitHead":"334c32b80ed536522b567ee6a844caf8e5fef9c3","scripts":{"test":"mocha -t 5000 -s 100 --reporter spec test"},"_npmUser":{"name":"mickhansen","email":"mick.kasper.hansen@gmail.com"},"repository":{"url":"git://github.com/mickhansen/dottie.js.git","type":"git"},"_npmVersion":"9.5.0","description":"Fast and safe nested object access and manipulation in JavaScript","directories":{},"_nodeVersion":"18.15.0","_hasShrinkwrap":false,"devDependencies":{"chai":"^4.2.0","mocha":"^10.2.0"},"_npmOperationalInternal":{"tmp":"tmp/dottie_2.0.7_1771947228317_0.42958664529380997","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","readme":"[![Build Status](https://travis-ci.org/mickhansen/dottie.js.svg?branch=master)](https://travis-ci.org/mickhansen/dottie.js)\n\nDottie helps you easily (and without sacrificing too much performance) look up and play with nested keys in objects, without them throwing up in your face.\n\n**Not actively maintained. You are likely better off using lodash or ES6+**\n\n## Install\n    npm install dottie\n\n## Usage\nFor detailed usage, check source or tests.\n\n### Get value\nGets nested value, or undefined if unreachable, or a default value if passed.\n\n```js\nvar values = {\n  some: {\n    nested: {\n        key: 'foobar';\n    }\n  },\n  'some.dot.included': {\n    key: 'barfoo'\n  }\n}\n\ndottie.get(values, 'some.nested.key'); // returns 'foobar'\ndottie.get(values, 'some.undefined.key'); // returns undefined\ndottie.get(values, 'some.undefined.key', 'defaultval'); // returns 'defaultval'\ndottie.get(values, ['some.dot.included', 'key']); // returns 'barfoo'\n```\n\n*Note: lodash.get() also works fine for this* \n\n### Set value\n\nSets nested value, creates nested structure if needed\n\n```js\ndottie.set(values, 'some.nested.value', someValue);\ndottie.set(values, ['some.dot.included', 'value'], someValue);\ndottie.set(values, 'some.nested.object', someValue, {\n  force: true // force overwrite defined non-object keys into objects if needed\n});\n```\n\n### Transform object\nTransform object from keys with dottie notation to nested objects\n\n```js\nvar values = {\n  'user.name': 'Gummy Bear',\n  'user.email': 'gummybear@candymountain.com',\n  'user.professional.title': 'King',\n  'user.professional.employer': 'Candy Mountain'\n};\nvar transformed = dottie.transform(values);\n\n/*\n{\n  user: {\n    name: 'Gummy Bear',\n    email: 'gummybear@candymountain.com',\n    professional: {\n      title: 'King',\n      employer: 'Candy Mountain'\n    }\n  }\n}\n*/\n```\n\n#### With a custom delimiter\n\n```js\nvar values = {\n  'user_name': 'Mick Hansen',\n  'user_email': 'maker@mhansen.io'\n};\nvar transformed = dottie.transform(values, { delimiter: '_' });\n\n/*\n{\n  user: {\n    name: 'Mick Hansen',\n    email: 'maker@mhansen.io'\n  }\n}\n*/\n```\n\n### Get paths in object\n```js\nvar object = {\n  a: 1,\n  b: {\n    c: 2,\n    d: { e: 3 }\n  }\n};\n\ndottie.paths(object); // [\"a\", \"b.c\", \"b.d.e\"];\n```\n\n## Performance\n\n`0.3.1` and up ships with `dottie.memoizePath: true` by default, if this causes any bugs, please try setting it to false\n\n## License\n\n[MIT](https://github.com/mickhansen/dottie.js/blob/master/LICENSE)\n","publish_time":1771947228458,"_cnpm_publish_time":1771947228458,"dist-tags":{"latest":"2.0.7"}}