{"_id":"dot-prop-legacy","_rev":"110493","name":"dot-prop-legacy","description":"Get, set, or delete a property from a nested object using a dot path","dist-tags":{"latest":"4.2.1"},"maintainers":[{"name":"fritzy","email":"fritzy@netflint.net"},{"name":"lukekarrys","email":"luke@lukekarrys.com"}],"time":{"modified":"2021-06-03T10:42:06.000Z","created":"2020-08-14T03:47:28.432Z","4.2.1":"2020-08-14T03:47:28.432Z"},"users":{},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/ruyadorno/dot-prop.git"},"versions":{"4.2.1":{"name":"dot-prop-legacy","version":"4.2.1","description":"Get, set, or delete a property from a nested object using a dot path","license":"MIT","repository":{"type":"git","url":"git+https://github.com/ruyadorno/dot-prop.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava","bench":"matcha bench.js"},"keywords":["obj","object","prop","property","dot","path","get","set","delete","del","access","notation","dotty"],"dependencies":{"is-obj":"^1.0.0"},"devDependencies":{"ava":"1.4.1","matcha":"^0.7.0","xo":"0.24.0"},"xo":{"esnext":true},"gitHead":"634382870ba4075e75430a923a75f1af6a28a97e","bugs":{"url":"https://github.com/ruyadorno/dot-prop/issues"},"homepage":"https://github.com/ruyadorno/dot-prop#readme","_id":"dot-prop-legacy@4.2.1","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"shasum":"ca8f75d79f1471af35d9129a2647aa346bf0df07","size":2742,"noattachment":false,"key":"/dot-prop-legacy/-/dot-prop-legacy-4.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/dot-prop-legacy/download/dot-prop-legacy-4.2.1.tgz"},"maintainers":[{"name":"fritzy","email":"fritzy@netflint.net"},{"name":"lukekarrys","email":"luke@lukekarrys.com"}],"_npmUser":{"name":"ruyadorno","email":"ruyadorno@hotmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dot-prop-legacy_4.2.1_1597376848295_0.30212771707378616"},"_hasShrinkwrap":false,"publish_time":1597376848432,"_cnpm_publish_time":1597376848432,"deprecated":"dot-prop released a v4.2.1, please migrate back to dot-prop@4.2.1 https://www.npmjs.com/package/dot-prop/v/4.2.1"}},"readme":"# dot-prop-legacy [![Build Status](https://travis-ci.org/ruyadorno/dot-prop.svg?branch=legacy-v4)](https://travis-ci.org/ruyadorno/dot-prop)\n\n> :warning: This is a fork of the original [dot-prop](https://github.com/sindresorhus/dot-prop) project with the only goal of keeping a legacy release line to make life of developers still supporting node@6 a little bit easier.\n\n> Get, set, or delete a property from a nested object using a dot path\n\n\n## Install\n\n```\n$ npm install --save dot-prop@npm:dot-prop-legacy\n```\n\n\n## Usage\n\n```js\nconst dotProp = require('dot-prop');\n\n// getter\ndotProp.get({foo: {bar: 'unicorn'}}, 'foo.bar');\n//=> 'unicorn'\n\ndotProp.get({foo: {bar: 'a'}}, 'foo.notDefined.deep');\n//=> undefined\n\ndotProp.get({foo: {bar: 'a'}}, 'foo.notDefined.deep', 'default value');\n//=> 'default value'\n\ndotProp.get({foo: {'dot.dot': 'unicorn'}}, 'foo.dot\\\\.dot');\n//=> 'unicorn'\n\n// setter\nconst obj = {foo: {bar: 'a'}};\ndotProp.set(obj, 'foo.bar', 'b');\nconsole.log(obj);\n//=> {foo: {bar: 'b'}}\n\nconst foo = dotProp.set({}, 'foo.bar', 'c');\nconsole.log(foo);\n//=> {foo: {bar: 'c'}}\n\ndotProp.set(obj, 'foo.baz', 'x');\nconsole.log(obj);\n//=> {foo: {bar: 'b', baz: 'x'}}\n\n// has\ndotProp.has({foo: {bar: 'unicorn'}}, 'foo.bar');\n//=> true\n\n// deleter\nconst obj = {foo: {bar: 'a'}};\ndotProp.delete(obj, 'foo.bar');\nconsole.log(obj);\n//=> {foo: {}}\n\nobj.foo.bar = {x: 'y', y: 'x'};\ndotProp.delete(obj, 'foo.bar.x');\nconsole.log(obj);\n//=> {foo: {bar: {y: 'x'}}}\n```\n\n\n## API\n\n### get(obj, path, [defaultValue])\n\n### set(obj, path, value)\n\nReturns the object.\n\n### has(obj, path)\n\n### delete(obj, path)\n\n#### obj\n\nType: `Object`\n\nObject to get, set, or delete the `path` value.\n\n#### path\n\nType: `string`\n\nPath of the property in the object, using `.` to separate each nested key.\n\nUse `\\\\.` if you have a `.` in the key.\n\nThe following path components are invalid and results in `undefined` being returned: `__proto__`, `prototype`, `constructor`.\n\n#### value\n\nType: `any`\n\nValue to set at `path`.\n\n#### defaultValue\n\nType: `any`\n\nDefault value.\n\n\n## License\n\nMIT © [Sindre Sorhus](https://sindresorhus.com)\n","_attachments":{},"homepage":"https://github.com/ruyadorno/dot-prop#readme","bugs":{"url":"https://github.com/ruyadorno/dot-prop/issues"},"license":"MIT"}