{"name":"set-value","version":"4.0.0","description":"Set nested properties on an object using dot notation.","license":"MIT","repository":{"type":"git","url":"git+https://github.com/jonschlinkert/set-value.git"},"homepage":"https://github.com/jonschlinkert/set-value","bugs":{"url":"https://github.com/jonschlinkert/set-value/issues"},"author":{"name":"Jon Schlinkert","email":"jon.schlinkert@sellside.com","url":"https://github.com/jonschlinkert"},"funding":["https://github.com/sponsors/jonschlinkert","https://paypal.me/jonathanschlinkert","https://jonschlinkert.dev/sponsor"],"contributors":[{"name":"Jon Schlinkert","url":"http://twitter.com/jonschlinkert"},{"url":"https://github.com/wtgtybhertgeghgtwtg"},{"name":"Vadim Demedes","url":"https://vadimdemedes.com"}],"main":"index.js","engines":{"node":">=11.0"},"scripts":{"test":"mocha"},"dependencies":{"is-plain-object":"^2.0.4"},"devDependencies":{"gulp-format-md":"^2.0.0","mocha":"^8.3.2","split-string":"^6.1.0"},"keywords":["bury","deep-get-set","deep-object","deep-property","deep-set-in","deep-set","deephas","dot-prop","dot2val","es5-dot-prop","get","getsetdeep","has","hasown","key","keys","lodash.set","nested","notation","object-path-set","object-path","object-set","object","patch","prop","properties","property","props","put","set-deep-prop","set-deep","set-nested-prop","set","setvalue","split-string","value","values"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"related":{"list":["assign-value","get-value","has-value","merge-value","omit-value","set-value","union-value","unset-value"]},"lint":{"reflinks":true},"reflinks":["bury","deep-get-set","deep-object","deep-property","deep-set","deep-set-in","deephas","dot-prop","dot2val","es5-dot-prop","getsetdeep","lodash.set","object-path","object-path-set","object-set","set-deep","set-deep-prop","set-nested-prop","setvalue","split-string","update"]},"gitHead":"010f017c4adc521d1d940c80f62cac7a5dc47c7e","_id":"set-value@4.0.0","_nodeVersion":"16.0.0","_npmVersion":"7.10.0","dist":{"integrity":"sha512-JtDpbHtnC5cNYKu9wk3f0Usbl2DOYCNHMHw/Ehn3DAxIMbqF2hj+cmfVjZj58OplqShE06wI6qpd3Puf6fzgVQ==","shasum":"be6a13aa6b30beecc18850d8dad1e726ab7695aa","tarball":"http://registry-npm.ywwl.com/set-value/download/set-value-4.0.0.tgz","fileCount":4,"unpackedSize":20529,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiOy4CRA9TVsSAnZWagAAdoQP/0U5pN3asB7iQJFajBFK\npiH/YwYllkqAhzjHzRl0ah9iCQDfEeornRp3yzlZtCiHFh8Hw594Ycj56HBa\nAMCulX81ygkXwerdsxc2h1JcIB7QUWXqZraUhsrucPTieIldkQ9QUQVXxkpe\nrQhT7wUkKKfTNSuHpM8dQsVE1clscQUcM1Pv0wO/euluomodjN4tAgzy2y3b\nsF4Am3a0E1TVUUS8lSOP0ap3Rhy402EFHxPg7qZtAViLdhXZZv9LtVN/cIfY\nL8/JgBclID1McW3FmE7Cc4X7Xc3Tql2CACIHeVh3lbjASNVoj5LxEiHKrY/E\nNvPqLsh8MoDWOXhLhaWC0JS++XOIsyywOYtsKNnOWFtDR8eqLcCOlqTTK9Ee\nl7PIZlthH+NqLZU2Ko6FQ4qutsCLohoJvErhcnnSgCi2qUTAjrySuL56AAOH\nJxwbv6XBAT+TEJx5x9KMtA4cFSgYUI26c1mgv6xl5NYpNV6dErDFiCNhSYMb\nmUWc63eHZJ+IeZZJTOELpYoxk3g0IA1EzL2lLmsl0KzzCQ/egGOZ3ZJy8m5q\nnfKRQ0Ra8jI5NSkUa535ZSnVHBVOD5uwGk9GfNi2zwIvM6uICWg5JOzHY23k\nQTiGntRg1NjgUu1iek3rlatnuC5bqncoQoy0o+zSwRSVnSwyU0aWhhI81wc5\nmvgf\r\n=DCwQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG+8ElUzHYg6m5yQyoPGRnAe7g18gi/fGbTo2lw3MM9EAiEArLezDb0z0Wm6T9JBOLzqAfZE2C9bojDCnkpoHyKLOWk="}],"size":6775,"noattachment":false,"key":"/set-value/-/set-value-4.0.0.tgz"},"_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"directories":{},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"},{"name":"doowb","email":"brian.woodward@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/set-value_4.0.0_1619586232289_0.7334891556114751"},"_hasShrinkwrap":false,"readme":"# set-value [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W8YFZ425KND68) [![NPM version](https://img.shields.io/npm/v/set-value.svg?style=flat)](https://www.npmjs.com/package/set-value) [![NPM monthly downloads](https://img.shields.io/npm/dm/set-value.svg?style=flat)](https://npmjs.org/package/set-value) [![NPM total downloads](https://img.shields.io/npm/dt/set-value.svg?style=flat)](https://npmjs.org/package/set-value) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/set-value.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/set-value)\n\n> Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths.\n\nPlease consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save set-value\n```\n\n## Heads up!\n\n[Please update](https://github.com/update/update) to version 3.0.1 or later, a critical bug was fixed in that version.\n\n## Usage\n\n```js\nconst set = require('set-value');\nset(object, prop, value);\n```\n\n### Params\n\n* `object` **{object}**: The object to set `value` on\n* `prop` **{string}**: The property to set. Dot-notation may be used.\n* `value` **{any}**: The value to set on `object[prop]`\n\n## Examples\n\nUpdates and returns the given object:\n\n```js\nconst obj = {};\nset(obj, 'a.b.c', 'd');\nconsole.log(obj);\n//=> { a: { b: { c: 'd' } } }\n```\n\n### Escaping\n\n**Escaping with backslashes**\n\nPrevent set-value from splitting on a dot by prefixing it with backslashes:\n\n```js\nconsole.log(set({}, 'a\\\\.b.c', 'd'));\n//=> { 'a.b': { c: 'd' } }\n\nconsole.log(set({}, 'a\\\\.b\\\\.c', 'd'));\n//=> { 'a.b.c': 'd' }\n```\n\n## Benchmarks\n\n_(benchmarks were run on a MacBook Pro 2.5 GHz Intel Core i7, 16 GB 1600 MHz DDR3)_.\n\nset-value is more reliable and has more features than dot-prop, without sacrificing performance.\n\n```\n# deep (194 bytes)\n  deep-object x 629,744 ops/sec ±0.85% (88 runs sampled)\n  deep-property x 1,470,427 ops/sec ±0.94% (89 runs sampled)\n  deep-set x 1,401,089 ops/sec ±1.02% (91 runs sampled)\n  deephas x 590,005 ops/sec ±1.73% (86 runs sampled)\n  dot-prop x 1,261,408 ops/sec ±0.94% (90 runs sampled)\n  dot2val x 1,672,729 ops/sec ±1.12% (89 runs sampled)\n  es5-dot-prop x 1,313,018 ops/sec ±0.79% (91 runs sampled)\n  lodash-set x 1,074,464 ops/sec ±0.97% (93 runs sampled)\n  object-path-set x 961,198 ops/sec ±2.07% (74 runs sampled)\n  object-set x 258,438 ops/sec ±0.69% (90 runs sampled)\n  set-value x 1,976,843 ops/sec ±2.07% (89 runs sampled)\n\n  fastest is set-value (by 186% avg)\n\n# medium (98 bytes)\n  deep-object x 3,249,287 ops/sec ±1.04% (93 runs sampled)\n  deep-property x 3,409,307 ops/sec ±1.28% (88 runs sampled)\n  deep-set x 3,240,776 ops/sec ±1.13% (93 runs sampled)\n  deephas x 960,504 ops/sec ±1.39% (89 runs sampled)\n  dot-prop x 2,776,388 ops/sec ±0.80% (94 runs sampled)\n  dot2val x 3,889,791 ops/sec ±1.28% (91 runs sampled)\n  es5-dot-prop x 2,779,604 ops/sec ±1.32% (91 runs sampled)\n  lodash-set x 2,791,304 ops/sec ±0.75% (90 runs sampled)\n  object-path-set x 2,462,084 ops/sec ±1.51% (91 runs sampled)\n  object-set x 838,569 ops/sec ±0.87% (90 runs sampled)\n  set-value x 4,767,287 ops/sec ±1.21% (91 runs sampled)\n\n  fastest is set-value (by 181% avg)\n\n# shallow (101 bytes)\n  deep-object x 4,793,168 ops/sec ±0.75% (88 runs sampled)\n  deep-property x 4,669,218 ops/sec ±1.17% (90 runs sampled)\n  deep-set x 4,648,247 ops/sec ±0.73% (91 runs sampled)\n  deephas x 1,246,414 ops/sec ±1.67% (92 runs sampled)\n  dot-prop x 3,913,694 ops/sec ±1.23% (89 runs sampled)\n  dot2val x 5,428,829 ops/sec ±0.76% (92 runs sampled)\n  es5-dot-prop x 3,897,931 ops/sec ±1.19% (92 runs sampled)\n  lodash-set x 6,128,638 ops/sec ±0.95% (87 runs sampled)\n  object-path-set x 5,429,978 ops/sec ±3.31% (87 runs sampled)\n  object-set x 1,529,485 ops/sec ±2.37% (89 runs sampled)\n  set-value x 7,150,921 ops/sec ±1.58% (89 runs sampled)\n\n  fastest is set-value (by 172% avg)\n\n```\n\n### Running the benchmarks\n\nClone this library into a local directory:\n\n```sh\n$ git clone https://github.com/jonschlinkert/set-value.git\n```\n\nThen install devDependencies and run benchmarks:\n\n```sh\n$ npm install && node benchmark\n```\n\n## Comparisons to other libs, or _\"the list of shame\"_\n\nThese are just a few of the duplicate libraries on NPM.\n\n* [bury](https://github.com/kalmbach/bury) fails all of the tests. I even wrapped it to have it return the object instead of the value, but with all of that work it still fails the vast majority of tests.\n* [deep-get-set](https://github.com/acstll/deep-get-set) fails 22 of 26 unit tests.\n* [deep-object](https://github.com/ayushgp/deep-object) fails 25 of 26 unit tests, completely butchered given objects.\n* [deep-property](https://github.com/mikattack/node-deep-property) fails 17 of 26 unit tests.\n* [deep-set](https://github.com/klaemo/deep-set) fails 13 of 26 unit tests.\n* [deephas](https://github.com/sharpred/deepHas) fails 17 of 26 unit tests.\n* [dot-prop](https://github.com/sindresorhus/dot-prop) fails 9 of 26 unit tests.\n* [dot2val](https://github.com/yangg/dot2val) fails 17 of 26 unit tests.\n* [es5-dot-prop](https://github.com/sindresorhus/dot-prop) fails 15 of 26 unit tests.\n* [getsetdeep](https://github.com/bevry/getsetdeep) fails all unit tests due to `this` being used improperly in the methods. I was able to patch it by binding the (plain) object to the methods, but it still fails 17 of 26 unit tests.\n* [lodash.set](https://lodash.com/) fails 11 of 26 unit tests.\n* [object-path-set](https://github.com/skratchdot/object-path-set) fails 12 of 26 unit tests.\n* [object-path](https://github.com/mariocasciaro/object-path) fails 16 of 26 unit tests.\n* [object-set](https://github.com/gearcase/object-set) fails 13 of 26 unit tests.\n* [set-nested-prop](https://github.com/tiaanduplessis/set-nested-prop) fails 24 of 26 unit tests.\n* [setvalue](https://github.com/blakeembrey/setvalue) (this library is almost identical to a previous version of this library)\n* Many dozens of others\n\n**Others that do the same thing, but use a completely different API**\n\n* [deep-set-in](https://github.com/KulikovskyIgor/deep-set-in)\n* [set-deep](https://github.com/radubrehar/set-deep)\n* [set-deep-prop](https://github.com/mmckelvy/set-deep-prop)\n* [bury](https://github.com/kalmbach/bury)\n* Many dozens of others\n\n## History\n\n### v3.0.0\n\n* Added support for a custom `split` function to be passed on the options.\n* Removed support for splitting on brackets, since a [custom function](https://github.com/jonschlinkert/split-string) can be passed to do this now.\n\n### v2.0.0\n\n* Adds support for escaping with double or single quotes. See [escaping](#escaping) for examples.\n* Will no longer split inside brackets or braces. See [bracket support](#bracket-support) for examples.\n\nIf there are any regressions please create a [bug report](../../issues/new). Thanks!\n\n## About\n\n<details>\n<summary><strong>Contributing</strong></summary>\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n</details>\n\n<details>\n<summary><strong>Running Tests</strong></summary>\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install && npm test\n```\n\n</details>\n\n<details>\n<summary><strong>Building docs</strong></summary>\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme && verb\n```\n\n</details>\n\n### Related projects\n\nYou might also be interested in these projects:\n\n* [assign-value](https://www.npmjs.com/package/assign-value): Assign a value or extend a deeply nested property of an object using object path… [more](https://github.com/jonschlinkert/assign-value) | [homepage](https://github.com/jonschlinkert/assign-value \"Assign a value or extend a deeply nested property of an object using object path notation.\")\n* [get-value](https://www.npmjs.com/package/get-value): Use property paths like 'a.b.c' to get a nested value from an object. Even works… [more](https://github.com/jonschlinkert/get-value) | [homepage](https://github.com/jonschlinkert/get-value \"Use property paths like 'a.b.c' to get a nested value from an object. Even works when keys have dots in them (no other dot-prop library can do this!).\")\n* [has-value](https://www.npmjs.com/package/has-value): Returns true if a value exists, false if empty. Works with deeply nested values using… [more](https://github.com/jonschlinkert/has-value) | [homepage](https://github.com/jonschlinkert/has-value \"Returns true if a value exists, false if empty. Works with deeply nested values using object paths.\")\n* [merge-value](https://www.npmjs.com/package/merge-value): Similar to assign-value but deeply merges object values or nested values using object path/dot notation. | [homepage](https://github.com/jonschlinkert/merge-value \"Similar to assign-value but deeply merges object values or nested values using object path/dot notation.\")\n* [omit-value](https://www.npmjs.com/package/omit-value): Omit properties from an object or deeply nested property of an object using object path… [more](https://github.com/jonschlinkert/omit-value) | [homepage](https://github.com/jonschlinkert/omit-value \"Omit properties from an object or deeply nested property of an object using object path notation.\")\n* [set-value](https://www.npmjs.com/package/set-value): Set nested properties on an object using dot notation. | [homepage](https://github.com/jonschlinkert/set-value \"Set nested properties on an object using dot notation.\")\n* [union-value](https://www.npmjs.com/package/union-value): Set an array of unique values as the property of an object. Supports setting deeply… [more](https://github.com/jonschlinkert/union-value) | [homepage](https://github.com/jonschlinkert/union-value \"Set an array of unique values as the property of an object. Supports setting deeply nested properties using using object-paths/dot notation.\")\n* [unset-value](https://www.npmjs.com/package/unset-value): Delete nested properties from an object using dot notation. | [homepage](https://github.com/jonschlinkert/unset-value \"Delete nested properties from an object using dot notation.\")\n\n### Contributors\n\n| **Commits** | **Contributor** |  \n| --- | --- |  \n| 90 | [jonschlinkert](https://github.com/jonschlinkert) |  \n| 4  | [doowb](https://github.com/doowb) |  \n| 2  | [mbelsky](https://github.com/mbelsky) |  \n| 1  | [dkebler](https://github.com/dkebler) |  \n| 1  | [GlennKintscher](https://github.com/GlennKintscher) |  \n| 1  | [petermorlion](https://github.com/petermorlion) |  \n| 1  | [abetomo](https://github.com/abetomo) |  \n| 1  | [zeidoo](https://github.com/zeidoo) |  \n| 1  | [ready-research](https://github.com/ready-research) |  \n| 1  | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) |  \n\n### Author\n\n**Jon Schlinkert**\n\n* [GitHub Profile](https://github.com/jonschlinkert)\n* [Twitter Profile](https://twitter.com/jonschlinkert)\n* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)\n\n### License\n\nCopyright © 2022, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on August 16, 2022._","publish_time":1619586232442,"_cnpm_publish_time":1619586232442,"dist-tags":{"latest":"4.1.0","patch":"2.0.1","patch-3.0.3":"3.0.3"}}