{"_id":"dset","_rev":"4319665","name":"dset","description":"A tiny (194B) utility for safely writing deep Object values~!","dist-tags":{"latest":"3.1.4"},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"time":{"modified":"2026-04-07T22:28:00.000Z","created":"2018-02-21T21:52:57.541Z","3.1.4":"2024-09-09T15:16:26.909Z","3.1.3":"2023-10-25T18:30:12.201Z","3.1.2":"2022-05-03T15:38:13.903Z","3.1.1":"2021-10-27T00:56:40.769Z","3.1.0":"2021-02-24T17:26:14.738Z","3.0.0":"2021-01-28T19:32:57.421Z","2.1.0":"2021-01-27T08:21:19.065Z","2.0.1":"2018-09-08T20:24:59.353Z","2.0.0":"2018-09-07T05:37:17.445Z","1.0.1":"2018-02-21T22:01:04.706Z","1.0.0":"2018-02-21T21:55:56.001Z","0.0.0":"2018-02-21T21:52:57.541Z"},"users":{},"author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"repository":{"type":"git","url":"git+https://github.com/lukeed/dset.git"},"versions":{"3.1.4":{"name":"dset","version":"3.1.4","repository":{"type":"git","url":"git+https://github.com/lukeed/dset.git"},"description":"A tiny (194B) utility for safely writing deep Object values~!","unpkg":"dist/index.min.js","umd:main":"dist/index.min.js","module":"dist/index.mjs","main":"dist/index.js","types":"index.d.ts","license":"MIT","exports":{".":{"types":"./index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./merge":{"types":"./merge/index.d.ts","import":"./merge/index.mjs","require":"./merge/index.js"},"./package.json":"./package.json"},"author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"engines":{"node":">=4"},"scripts":{"build":"bundt","test":"uvu test -r esm -i suites"},"modes":{"merge":"src/merge.js","default":"src/index.js"},"keywords":["deepset","values","object","write","deep","safe","set"],"devDependencies":{"bundt":"1.1.2","esm":"3.2.25","uvu":"0.5.1"},"_id":"dset@3.1.4","gitHead":"05b1ec0f8cebe3b5d5667285bc7da90f38a7215e","bugs":{"url":"https://github.com/lukeed/dset/issues"},"homepage":"https://github.com/lukeed/dset#readme","_nodeVersion":"20.10.0","_npmVersion":"10.2.3","dist":{"shasum":"f8eaf5f023f068a036d08cd07dc9ffb7d0065248","size":4353,"noattachment":false,"key":"/dset/-/dset-3.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/dset/download/dset-3.1.4.tgz"},"_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"directories":{},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dset_3.1.4_1725894986727_0.9501784197603693"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-09-09T15:16:26.909Z","publish_time":1725894986909,"_source_registry_name":"default","_cnpm_publish_time":1725894986909},"3.1.3":{"name":"dset","version":"3.1.3","repository":{"type":"git","url":"git+https://github.com/lukeed/dset.git"},"description":"A tiny (194B) utility for safely writing deep Object values~!","unpkg":"dist/index.min.js","umd:main":"dist/index.min.js","module":"dist/index.mjs","main":"dist/index.js","types":"index.d.ts","license":"MIT","exports":{".":{"types":"./index.d.ts","import":"./dist/index.mjs","require":"./dist/index.js"},"./merge":{"types":"./merge/index.d.ts","import":"./merge/index.mjs","require":"./merge/index.js"},"./package.json":"./package.json"},"author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"engines":{"node":">=4"},"scripts":{"build":"bundt","test":"uvu test -r esm -i suites"},"modes":{"merge":"src/merge.js","default":"src/index.js"},"keywords":["deepset","values","object","write","deep","safe","set"],"devDependencies":{"bundt":"1.1.2","esm":"3.2.25","uvu":"0.5.1"},"_id":"dset@3.1.3","gitHead":"48f14a1a4b2985c30663133e4699ddab69a393ac","bugs":{"url":"https://github.com/lukeed/dset/issues"},"homepage":"https://github.com/lukeed/dset#readme","_nodeVersion":"20.8.1","_npmVersion":"10.1.0","dist":{"shasum":"c194147f159841148e8e34ca41f638556d9542d2","size":4532,"noattachment":false,"key":"/dset/-/dset-3.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/dset/download/dset-3.1.3.tgz"},"_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"directories":{},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dset_3.1.3_1698258611975_0.6441856182602657"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-10-25T18:30:12.201Z","publish_time":1698258612201,"_source_registry_name":"default","_cnpm_publish_time":1698258612201},"3.1.2":{"name":"dset","version":"3.1.2","repository":{"type":"git","url":"git+https://github.com/lukeed/dset.git"},"description":"A tiny (194B) utility for safely writing deep Object values~!","unpkg":"dist/index.min.js","umd:main":"dist/index.min.js","module":"dist/index.mjs","main":"dist/index.js","types":"index.d.ts","license":"MIT","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js"},"./merge":{"import":"./merge/index.mjs","require":"./merge/index.js"},"./package.json":"./package.json"},"author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"engines":{"node":">=4"},"scripts":{"build":"bundt","test":"uvu test -r esm -i suites"},"modes":{"merge":"src/merge.js","default":"src/index.js"},"keywords":["deepset","values","object","write","deep","safe","set"],"devDependencies":{"bundt":"1.1.2","esm":"3.2.25","uvu":"0.5.1"},"gitHead":"740b3aeec52b28244be05c8c73f40921c4434851","bugs":{"url":"https://github.com/lukeed/dset/issues"},"homepage":"https://github.com/lukeed/dset#readme","_id":"dset@3.1.2","_nodeVersion":"16.13.0","_npmVersion":"8.1.0","dist":{"shasum":"89c436ca6450398396dc6538ea00abc0c54cd45a","size":4292,"noattachment":false,"key":"/dset/-/dset-3.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/dset/download/dset-3.1.2.tgz"},"_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"directories":{},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dset_3.1.2_1651592293749_0.8683858171836747"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-05-03T15:46:13.626Z","publish_time":1651592293903,"_cnpm_publish_time":1651592293903},"3.1.1":{"name":"dset","version":"3.1.1","repository":{"type":"git","url":"git+https://github.com/lukeed/dset.git"},"description":"A tiny (194B) utility for safely writing deep Object values~!","unpkg":"dist/index.min.js","umd:main":"dist/index.min.js","module":"dist/index.mjs","main":"dist/index.js","types":"index.d.ts","license":"MIT","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js"},"./merge":{"import":"./merge/index.mjs","require":"./merge/index.js"},"./package.json":"./package.json"},"author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"engines":{"node":">=4"},"scripts":{"build":"bundt","test":"uvu test -r esm -i suites"},"modes":{"merge":"src/merge.js","default":"src/index.js"},"keywords":["deepset","values","object","write","deep","safe","set"],"devDependencies":{"bundt":"1.1.2","esm":"3.2.25","uvu":"0.5.1"},"gitHead":"fb41df6b0136016c238d2f31cc65d6bf0120f826","bugs":{"url":"https://github.com/lukeed/dset/issues"},"homepage":"https://github.com/lukeed/dset#readme","_id":"dset@3.1.1","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"shasum":"07de5af7a8d03eab337ad1a8ba77fe17bba61a8c","size":4287,"noattachment":false,"key":"/dset/-/dset-3.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/dset/download/dset-3.1.1.tgz"},"_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"directories":{},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dset_3.1.1_1635296200400_0.6568781493696605"},"_hasShrinkwrap":false,"publish_time":1635296200769,"_cnpm_publish_time":1635296200769},"3.1.0":{"name":"dset","version":"3.1.0","repository":{"type":"git","url":"git+https://github.com/lukeed/dset.git"},"description":"A tiny (196B) utility for safely writing deep Object values~!","unpkg":"dist/index.min.js","umd:main":"dist/index.min.js","module":"dist/index.mjs","main":"dist/index.js","types":"index.d.ts","license":"MIT","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js"},"./merge":{"import":"./merge/index.mjs","require":"./merge/index.js"},"./package.json":"./package.json"},"author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"engines":{"node":">=4"},"scripts":{"build":"bundt","test":"uvu test -r esm -i suites"},"modes":{"merge":"src/merge.js","default":"src/index.js"},"keywords":["deepset","values","object","write","deep","safe","set"],"devDependencies":{"bundt":"1.1.2","esm":"3.2.25","uvu":"0.5.1"},"gitHead":"6515792797c398682864a2cc26907585748f3a71","bugs":{"url":"https://github.com/lukeed/dset/issues"},"homepage":"https://github.com/lukeed/dset#readme","_id":"dset@3.1.0","_nodeVersion":"14.15.5","_npmVersion":"6.14.11","dist":{"shasum":"23feb6df93816ea452566308b1374d6e869b0d7b","size":4554,"noattachment":false,"key":"/dset/-/dset-3.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/dset/download/dset-3.1.0.tgz"},"_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"directories":{},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dset_3.1.0_1614187574612_0.7758807628068767"},"_hasShrinkwrap":false,"publish_time":1614187574738,"_cnpm_publish_time":1614187574738},"3.0.0":{"name":"dset","version":"3.0.0","repository":{"type":"git","url":"git+https://github.com/lukeed/dset.git"},"description":"A tiny (196B) utility for safely writing deep Object values~!","unpkg":"dist/index.min.js","umd:main":"dist/index.min.js","module":"dist/index.mjs","main":"dist/index.js","types":"index.d.ts","license":"MIT","exports":{".":{"import":"./dist/index.mjs","require":"./dist/index.js"},"./package.json":"./package.json"},"author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"engines":{"node":">=4"},"scripts":{"build":"bundt","test":"uvu -r esm test"},"keywords":["deepset","values","object","write","deep","safe","set"],"devDependencies":{"bundt":"1.1.2","esm":"3.2.25","uvu":"0.5.1"},"gitHead":"7178ab2e1b70f958189c9032702dd76be81dd09a","bugs":{"url":"https://github.com/lukeed/dset/issues"},"homepage":"https://github.com/lukeed/dset#readme","_id":"dset@3.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"dist":{"shasum":"b49ef4a6a092c2c5328618eca2ccf6885fafb431","size":3239,"noattachment":false,"key":"/dset/-/dset-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/dset/download/dset-3.0.0.tgz"},"directories":{},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dset_3.0.0_1611862377235_0.5284587391832587"},"_hasShrinkwrap":false,"publish_time":1611862377421,"_cnpm_publish_time":1611862377421},"2.1.0":{"name":"dset","version":"2.1.0","repository":{"type":"git","url":"git+https://github.com/lukeed/dset.git"},"description":"A tiny (190B) utility for safely writing deep Object values~!","unpkg":"dist/dset.min.js","umd:main":"dist/dset.min.js","module":"dist/dset.es.js","main":"dist/dset.js","types":"index.d.ts","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"https://lukeed.com"},"engines":{"node":">=4"},"scripts":{"build":"bundt","pretest":"npm run build","test":"uvu test"},"keywords":["deepset","values","object","write","deep","safe","set"],"devDependencies":{"bundt":"1.1.2","uvu":"0.5.1"},"gitHead":"113244b13bb34d383a1e72385c83a89616239741","bugs":{"url":"https://github.com/lukeed/dset/issues"},"homepage":"https://github.com/lukeed/dset#readme","_id":"dset@2.1.0","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"dist":{"shasum":"cd1e99e55cf32366d8f144f906c42f7fb3bf431e","size":3042,"noattachment":false,"key":"/dset/-/dset-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/dset/download/dset-2.1.0.tgz"},"directories":{},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dset_2.1.0_1611735678943_0.2364839475517686"},"_hasShrinkwrap":false,"publish_time":1611735679065,"_cnpm_publish_time":1611735679065},"2.0.1":{"name":"dset","version":"2.0.1","repository":{"type":"git","url":"git+https://github.com/lukeed/dset.git"},"description":"A tiny (161B) utility for safely writing deep Object values~!","unpkg":"dist/dset.min.js","umd:main":"dist/dset.min.js","module":"dist/dset.es.js","main":"dist/dset.js","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"lukeed.com"},"engines":{"node":">=4"},"scripts":{"build":"node builder","pretest":"npm run build","test":"tape test/*.js | tap-spec"},"keywords":["deepset","values","object","write","deep","safe","set"],"devDependencies":{"gzip-size":"^3.0.0","mk-dirs":"^1.0.0","pretty-bytes":"^4.0.2","rewrite-imports":"^1.0.0","tap-spec":"^4.1.1","tape":"^4.8.0","uglify-js":"^3.2.0"},"gitHead":"215b634f0e5ead89ae8f3579e1bff819bbed92ec","bugs":{"url":"https://github.com/lukeed/dset/issues"},"homepage":"https://github.com/lukeed/dset#readme","_id":"dset@2.0.1","_shasum":"a15fff3d1e4d60ac0c95634625cbd5441a76deb1","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.1","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"dist":{"shasum":"a15fff3d1e4d60ac0c95634625cbd5441a76deb1","size":2555,"noattachment":false,"key":"/dset/-/dset-2.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/dset/download/dset-2.0.1.tgz"},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dset_2.0.1_1536438299239_0.4496956083062793"},"_hasShrinkwrap":false,"publish_time":1536438299353,"_cnpm_publish_time":1536438299353,"deprecated":"Please use dset@2.1.0 or later for an important security patch"},"2.0.0":{"name":"dset","version":"2.0.0","repository":{"type":"git","url":"git+https://github.com/lukeed/dset.git"},"description":"A tiny (144B) utility for safely writing deep Object values~!","unpkg":"dist/dset.min.js","umd:main":"dist/dset.min.js","module":"dist/dset.es.js","main":"dist/dset.js","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"lukeed.com"},"engines":{"node":">=4"},"scripts":{"build":"node builder","pretest":"npm run build","test":"tape test/*.js | tap-spec"},"keywords":["deepset","values","object","write","deep","safe","set"],"devDependencies":{"gzip-size":"^3.0.0","mk-dirs":"^1.0.0","pretty-bytes":"^4.0.2","rewrite-imports":"^1.0.0","tap-spec":"^4.1.1","tape":"^4.8.0","uglify-js":"^3.2.0"},"gitHead":"e836a01c07a439587a3d1f3c49cd002b750b8a90","bugs":{"url":"https://github.com/lukeed/dset/issues"},"homepage":"https://github.com/lukeed/dset#readme","_id":"dset@2.0.0","_shasum":"7353401525245e678a25ac66643462f372a71534","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.1","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"dist":{"shasum":"7353401525245e678a25ac66643462f372a71534","size":2520,"noattachment":false,"key":"/dset/-/dset-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/dset/download/dset-2.0.0.tgz"},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dset_2.0.0_1536298637319_0.693838142036399"},"_hasShrinkwrap":false,"publish_time":1536298637445,"_cnpm_publish_time":1536298637445,"deprecated":"Please use dset@2.1.0 or later for an important security patch"},"1.0.1":{"name":"dset","version":"1.0.1","repository":{"type":"git","url":"git+https://github.com/lukeed/dset.git"},"description":"A tiny (135B) utility for safely writing deep Object values~!","module":"dist/dset.es.js","main":"dist/dset.js","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"lukeed.com"},"engines":{"node":">=4"},"scripts":{"build":"node builder","pretest":"npm run build","test":"tape test/*.js | tap-spec"},"files":["dist"],"keywords":["deepset","values","object","write","deep","safe","set"],"devDependencies":{"gzip-size":"^3.0.0","mk-dirs":"^1.0.0","pretty-bytes":"^4.0.2","rewrite-imports":"^1.0.0","tap-spec":"^4.1.1","tape":"^4.8.0","uglify-js":"^3.2.0"},"gitHead":"706a66d2cef13e6724309ac6684cdfc89afa053e","bugs":{"url":"https://github.com/lukeed/dset/issues"},"homepage":"https://github.com/lukeed/dset#readme","_id":"dset@1.0.1","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"dist":{"shasum":"0ece3c8c987197e9fe5b6c87dc7970c0862f6751","size":2207,"noattachment":false,"key":"/dset/-/dset-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/dset/download/dset-1.0.1.tgz"},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dset_1.0.1_1519250464648_0.15612966421431884"},"_hasShrinkwrap":false,"publish_time":1519250464706,"_cnpm_publish_time":1519250464706,"deprecated":"Please use dset@2.1.0 or later for an important security patch"},"1.0.0":{"name":"dset","version":"1.0.0","repository":{"type":"git","url":"git+https://github.com/lukeed/dset.git"},"description":"A tiny (135B) utility for safely writing deep Object values~!","module":"dist/dset.es.js","main":"dist/dset.js","license":"MIT","author":{"name":"Luke Edwards","email":"luke.edwards05@gmail.com","url":"lukeed.com"},"engines":{"node":">=4"},"scripts":{"build":"node builder","pretest":"npm run build","test":"tape test/*.js | tap-spec"},"files":["dist"],"keywords":["deepset","values","object","write","deep","safe","set"],"devDependencies":{"gzip-size":"^3.0.0","mk-dirs":"^1.0.0","pretty-bytes":"^4.0.2","rewrite-imports":"^1.0.0","tap-spec":"^4.1.1","tape":"^4.8.0","uglify-js":"^3.2.0"},"gitHead":"ad8efb35e48b1b8eb09f4eaa7ac62246b781a2cc","bugs":{"url":"https://github.com/lukeed/dset/issues"},"homepage":"https://github.com/lukeed/dset#readme","_id":"dset@1.0.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"dist":{"shasum":"096166f287fcdadcf10c7b94e9afcf9922f990eb","size":2237,"noattachment":false,"key":"/dset/-/dset-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/dset/download/dset-1.0.0.tgz"},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dset_1.0.0_1519250155921_0.06744305341063006"},"_hasShrinkwrap":false,"publish_time":1519250156001,"_cnpm_publish_time":1519250156001,"deprecated":"Please use dset@2.1.0 or later for an important security patch"},"0.0.0":{"name":"dset","version":"0.0.0","_id":"dset@0.0.0","scripts":{},"_shasum":"12ef0d38476eba4d5cac746225e395cd4e1f9f04","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.11.1","_npmUser":{"name":"lukeed","email":"luke@lukeed.com"},"dist":{"shasum":"12ef0d38476eba4d5cac746225e395cd4e1f9f04","size":152,"noattachment":false,"key":"/dset/-/dset-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/dset/download/dset-0.0.0.tgz"},"maintainers":[{"name":"lukeed","email":"luke@lukeed.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/dset_0.0.0_1519249977481_0.3298479417100191"},"_hasShrinkwrap":false,"publish_time":1519249977541,"_cnpm_publish_time":1519249977541,"deprecated":"Please use dset@2.1.0 or later for an important security patch"}},"readme":"# dset [![CI](https://github.com/lukeed/dset/workflows/CI/badge.svg?branch=master&event=push)](https://github.com/lukeed/dset/actions) [![codecov](https://badgen.net/codecov/c/github/lukeed/dset)](https://codecov.io/gh/lukeed/dset)\n\n> A tiny (197B) utility for safely writing deep Object values~!\n\nFor _accessing_ deep object properties, please see [`dlv`](https://github.com/developit/dlv).\n\n> **Using GraphQL?** You may want `dset/merge` – see [Merging](#merging) for more info.\n\n## Install\n\n```sh\n$ npm install --save dset\n```\n\n## Modes\n\nThere are two \"versions\" of `dset` available:\n\n#### `dset`\n> **Size (gzip):** 197 bytes<br>\n> **Availability:** [CommonJS](https://unpkg.com/dset/dist/index.js), [ES Module](https://unpkg.com/dset/dist/index.mjs), [UMD](https://unpkg.com/dset/dist/index.min.js)\n\n```js\nimport { dset } from 'dset';\n```\n\n#### `dset/merge`\n> **Size (gzip):** 307 bytes<br>\n> **Availability:** [CommonJS](https://unpkg.com/dset/merge/index.js), [ES Module](https://unpkg.com/dset/merge/index.mjs), [UMD](https://unpkg.com/dset/merge/index.min.js)\n\n```js\nimport { dset } from 'dset/merge';\n```\n\n\n## Usage\n\n```js\nimport { dset } from 'dset';\n\nlet foo = { abc: 123 };\ndset(foo, 'foo.bar', 'hello');\n// or: dset(foo, ['foo', 'bar'], 'hello');\nconsole.log(foo);\n//=> {\n//=>   abc: 123,\n//=>   foo: { bar: 'hello' },\n//=> }\n\ndset(foo, 'abc.hello', 'world');\n// or: dset(foo, ['abc', 'hello'], 'world');\nconsole.log(foo);\n//=> {\n//=>   abc: { hello: 'world' },\n//=>   foo: { bar: 'hello' },\n//=> }\n\nlet bar = { a: { x: 7 }, b:[1, 2, 3] };\ndset(bar, 'b.1', 999);\n// or: dset(bar, ['b', 1], 999);\n// or: dset(bar, ['b', '1'], 999);\nconsole.log(bar);\n//=> {\n//=>   a: { x: 7 },\n//=>   b: [1, 999, 3],\n//=> }\n\ndset(bar, 'a.y.0', 8);\n// or: dset(bar, ['a', 'y', 0], 8);\n// or: dset(bar, ['a', 'y', '0'], 8);\nconsole.log(bar);\n//=> {\n//=>   a: {\n//=>     x: 7,\n//=>     y: [8],\n//=>   },\n//=>   b: [1, 999, 3],\n//=> }\n\nlet baz = {};\ndset(baz, 'a.0.b.0', 1);\ndset(baz, 'a.0.b.1', 2);\nconsole.log(baz);\n//=> {\n//=>   a: [{ b: [1, 2] }]\n//=> }\n```\n\n## Merging\n\nThe main/default `dset` module forcibly writes values at the assigned key-path. However, in some cases, you may prefer to _merge_ values at the key-path. For example, when using [GraphQL's `@stream` and `@defer` directives](https://foundation.graphql.org/news/2020/12/08/improving-latency-with-defer-and-stream-directives/), you will need to merge the response chunks into a single object/list. This is why `dset/merge` exists~!\n\nBelow is a quick illustration of the difference between `dset` and `dset/merge`:\n\n```js\nlet input = {\n  hello: {\n    abc: 123\n  }\n};\n\ndset(input, 'hello', { world: 123 });\nconsole.log(input);\n\n// via `dset`\n//=> {\n//=>   hello: {\n//=>     world: 123\n//=>   }\n//=> }\n\n// via `dset/merge`\n//=> {\n//=>   hello: {\n//=>     abc: 123,\n//=>     world: 123\n//=>   }\n//=> }\n```\n\n\n## Immutability\n\nAs shown in the examples above, all `dset` interactions mutate the source object.\n\nIf you need immutable writes, please visit [`clean-set`](https://github.com/fwilkerson/clean-set) (182B).<br>\nAlternatively, you may pair `dset` with [`klona`](https://github.com/lukeed/klona), a 366B utility to clone your source(s). Here's an example pairing:\n\n```js\nimport { dset } from 'dset';\nimport { klona } from 'klona';\n\nexport function deepset(obj, path, val) {\n  let copy = klona(obj);\n  dset(copy, path, val);\n  return copy;\n}\n```\n\n\n## API\n\n### dset(obj, path, val)\n\nReturns: `void`\n\n#### obj\n\nType: `Object`\n\nThe Object to traverse & mutate with a value.\n\n#### path\n\nType: `String` or `Array`\n\nThe key path that should receive the value. May be in `x.y.z` or `['x', 'y', 'z']` formats.\n\n> **Note:** Please be aware that only the _last_ key actually receives the value!\n\n> **Important:** New Objects are created at each segment if there is not an existing structure.<br>However, when integers are encounted, Arrays are created instead!\n\n#### value\n\nType: `Any`\n\nThe value that you want to set. Can be of any type!\n\n\n## Benchmarks\n\nFor benchmarks and full results, check out the [`bench`](/bench) directory!\n\n```\n# Node 10.13.0\n\nValidation:\n  ✔ set-value\n  ✔ lodash/set\n  ✔ dset\n\nBenchmark:\n  set-value    x 1,701,821 ops/sec ±1.81% (93 runs sampled)\n  lodash/set   x   975,530 ops/sec ±0.96% (91 runs sampled)\n  dset         x 1,797,922 ops/sec ±0.32% (94 runs sampled)\n```\n\n\n## Related\n\n- [dlv](https://github.com/developit/dlv) - safely read from deep properties in 120 bytes\n- [dequal](https://github.com/lukeed/dequal) - safely check for deep equality in 247 bytes\n- [klona](https://github.com/lukeed/klona) - quickly \"deep clone\" data in 200 to 330 bytes\n- [clean-set](https://github.com/fwilkerson/clean-set) - fast, immutable version of `dset` in 182 bytes\n\n\n## License\n\nMIT © [Luke Edwards](https://lukeed.com)\n","_attachments":{},"homepage":"https://github.com/lukeed/dset#readme","bugs":{"url":"https://github.com/lukeed/dset/issues"},"license":"MIT"}