{"versions":{"1.1.2":{"name":"clean-set","version":"1.1.2","description":"A fast deep assignment alternative to the object spread operator and Object.assign","umd:main":"dist/clean-set.min.js","module":"dist/clean-set.es.js","main":"dist/clean-set.js","source":"lib/index.js","typings":"index.d.ts","scripts":{"build":"microbundle","coverage":"nyc report --reporter=text-lcov > coverage.lcov && codecov","tap":"tape -r esm tests/**/*.js | tap-difflet","test":"nyc --reporter=text npm run tap"},"repository":{"type":"git","url":"git+https://github.com/fwilkerson/clean-set.git"},"keywords":[],"author":{"name":"Frank A. Wilkerson"},"license":"MIT","bugs":{"url":"https://github.com/fwilkerson/clean-set/issues"},"homepage":"https://github.com/fwilkerson/clean-set#readme","devDependencies":{"codecov":"^3.2.0","esm":"^3.2.18","microbundle":"^0.12.0","nyc":"^15.0.1","prettier":"^1.16.4","tap-difflet":"^0.7.1","tape":"^4.10.1"},"gitHead":"2366343c2d49b0ea02714db87b9996f0dbc25cd1","_id":"clean-set@1.1.2","_nodeVersion":"12.14.1","_npmVersion":"6.13.4","dist":{"shasum":"76d8bf238c3e27827bfa73073ecdfdc767187070","size":18941,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/clean-set/-/clean-set-1.1.2.tgz","integrity":"sha512-cA8uCj0qSoG9e0kevyOWXwPaELRPVg5Pxp6WskLMwerx257Zfnh8Nl0JBH59d7wQzij2CK7qEfJQK3RjuKKIug=="},"maintainers":[{"name":"anonymous","email":"frank.wilkerson@outlook.com"}],"_npmUser":{"name":"anonymous","email":"frank.wilkerson@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clean-set_1.1.2_1589520612313_0.8476372118020261"},"_hasShrinkwrap":false,"publish_time":1589520612533,"_cnpm_publish_time":1589520612533,"_cnpmcore_publish_time":"2021-12-16T20:21:58.046Z","contributors":[]},"1.1.1":{"name":"clean-set","version":"1.1.1","description":"A fast deep assignment alternative to the object spread operator and Object.assign","umd:main":"dist/clean-set.min.js","module":"dist/clean-set.es.js","main":"dist/clean-set.js","source":"lib/index.js","typings":"index.d.ts","scripts":{"build":"microbundle","coverage":"nyc report --reporter=text-lcov > coverage.lcov && codecov","tap":"tape -r esm tests/**/*.js | tap-difflet","test":"nyc --reporter=text npm run tap"},"repository":{"type":"git","url":"git+https://github.com/fwilkerson/clean-set.git"},"keywords":[],"author":{"name":"Frank A. Wilkerson"},"license":"MIT","bugs":{"url":"https://github.com/fwilkerson/clean-set/issues"},"homepage":"https://github.com/fwilkerson/clean-set#readme","devDependencies":{"codecov":"^3.2.0","esm":"^3.2.18","microbundle":"^0.11.0","nyc":"^13.3.0","prettier":"^1.16.4","tap-difflet":"^0.7.1","tape":"^4.10.1"},"gitHead":"61426c81bd7f70a995a9aad7ab15926e5801ed63","_id":"clean-set@1.1.1","_nodeVersion":"10.15.1","_npmVersion":"6.8.0","dist":{"shasum":"513a0930d0d0e3c0746311ed36e476a07f50facb","size":18586,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/clean-set/-/clean-set-1.1.1.tgz","integrity":"sha512-Y6SWC6BKolLY9oAMaeK2PXJddllH+lpwFtP+KOK8hs+2gS8O2KN9a/j71pmIuTcF+JPh/2TPgVDliJ4x8JQCdA=="},"maintainers":[{"name":"anonymous","email":"frank.wilkerson@outlook.com"}],"_npmUser":{"name":"anonymous","email":"frank.wilkerson@outlook.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clean-set_1.1.1_1552792887331_0.6719119977271728"},"_hasShrinkwrap":false,"publish_time":1552792887552,"_cnpm_publish_time":1552792887552,"_cnpmcore_publish_time":"2021-12-16T20:21:58.661Z","contributors":[]},"1.1.0":{"name":"clean-set","version":"1.1.0","description":"A fast deep assignment alternative to the object spread operator and Object.assign","umd:main":"dist/clean-set.min.js","module":"dist/clean-set.es.js","main":"dist/clean-set.js","source":"lib/index.js","typings":"index.d.ts","scripts":{"build":"microbundle","coverage":"nyc report --reporter=text-lcov > coverage.lcov && codecov","tap":"tape -r esm tests/**/*.js | tap-difflet","test":"nyc --reporter=text npm run tap"},"repository":{"type":"git","url":"git+https://github.com/fwilkerson/clean-set.git"},"keywords":[],"author":{"name":"Frank A. Wilkerson"},"license":"MIT","bugs":{"url":"https://github.com/fwilkerson/clean-set/issues"},"homepage":"https://github.com/fwilkerson/clean-set#readme","devDependencies":{"codecov":"^3.0.2","esm":"^3.0.46","microbundle":"^0.4.4","nyc":"^12.0.2","prettier":"^1.13.4","tap-difflet":"^0.7.1","tape":"^4.9.0"},"gitHead":"a83e26efc7cd818eac89b7069a7303d6e75dc9fb","_id":"clean-set@1.1.0","_npmVersion":"5.5.1","_nodeVersion":"8.9.0","_npmUser":{"name":"anonymous","email":"frank.wilkerson@outlook.com"},"dist":{"shasum":"507860370e6e44521f4a4a516c977a864aa8a765","size":18377,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/clean-set/-/clean-set-1.1.0.tgz","integrity":"sha512-eWzgp8bQMvGVdLI8k56c4G08ez9+t7J0pmBarJ0uDv8Fc5FvQL1LWxH5TmfYUCblUi3lC7/LCvQIwsgcv6BhzQ=="},"maintainers":[{"name":"anonymous","email":"frank.wilkerson@outlook.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clean-set_1.1.0_1529617147765_0.968497556391495"},"_hasShrinkwrap":false,"publish_time":1529617147846,"_cnpm_publish_time":1529617147846,"_cnpmcore_publish_time":"2021-12-16T20:21:58.868Z","contributors":[]},"1.0.0":{"name":"clean-set","version":"1.0.0","description":"A fast deep assignment alternative to the object spread operator and Object.assign","umd:main":"dist/clean-set.min.js","module":"dist/clean-set.es.js","main":"dist/clean-set.js","source":"lib/index.js","typings":"index.d.ts","scripts":{"build":"microbundle","coverage":"nyc report --reporter=text-lcov > coverage.lcov && codecov","tap":"tape -r esm tests/**/*.js | tap-difflet","test":"nyc --reporter=text npm run tap"},"repository":{"type":"git","url":"git+https://github.com/fwilkerson/clean-set.git"},"keywords":[],"author":{"name":"Frank A. Wilkerson"},"license":"MIT","bugs":{"url":"https://github.com/fwilkerson/clean-set/issues"},"homepage":"https://github.com/fwilkerson/clean-set#readme","devDependencies":{"codecov":"^3.0.2","esm":"^3.0.46","microbundle":"^0.4.4","nyc":"^12.0.2","prettier":"^1.13.4","tap-difflet":"^0.7.1","tape":"^4.9.0"},"gitHead":"2b84025de79f7f94378498d1e0b4e4b81b03b903","_id":"clean-set@1.0.0","_npmVersion":"6.1.0","_nodeVersion":"10.3.0","_npmUser":{"name":"anonymous","email":"frank.wilkerson@outlook.com"},"dist":{"shasum":"5d18b870e77b804f7b10907a14e0ea6f9c2d43ed","size":18032,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/clean-set/-/clean-set-1.0.0.tgz","integrity":"sha512-yf0tuJpRy05+fLP+jQaiMzrwJu6NH8SsBBwbgZXbunSGKL2cRUDwG+y7gZ6mfz9H3gIuPzv7CTz+mO/Ccys9yg=="},"maintainers":[{"name":"anonymous","email":"frank.wilkerson@outlook.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clean-set_1.0.0_1528269392950_0.5781301296174315"},"_hasShrinkwrap":false,"publish_time":1528269393046,"_cnpm_publish_time":1528269393046,"_cnpmcore_publish_time":"2021-12-16T20:21:59.547Z","contributors":[]},"0.0.1":{"name":"clean-set","version":"0.0.1","description":"A fast deep assignment alternative to the object spread operator and Object.assign","umd:main":"dist/clean-set.min.js","module":"dist/clean-set.es.js","main":"dist/clean-set.js","source":"lib/index.js","typings":"index.d.ts","scripts":{"build":"microbundle","coverage":"nyc report --reporter=text-lcov > coverage.lcov && codecov","tap":"tape -r esm tests/**/*.js | tap-difflet","test":"nyc --reporter=text npm run tap"},"repository":{"type":"git","url":"git+https://github.com/fwilkerson/clean-set.git"},"keywords":[],"author":{"name":"Frank A. Wilkerson"},"license":"MIT","bugs":{"url":"https://github.com/fwilkerson/clean-set/issues"},"homepage":"https://github.com/fwilkerson/clean-set#readme","devDependencies":{"codecov":"^3.0.2","esm":"^3.0.46","microbundle":"^0.4.4","nyc":"^12.0.2","prettier":"^1.13.4","tap-difflet":"^0.7.1","tape":"^4.9.0"},"gitHead":"1d55385515aa35922b1a58b3acd240e9243b4651","_id":"clean-set@0.0.1","_npmVersion":"6.1.0","_nodeVersion":"10.3.0","_npmUser":{"name":"anonymous","email":"frank.wilkerson@outlook.com"},"dist":{"shasum":"b2d9dc62d27876552c167bb3eaf4ac408a9c9a26","size":17737,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/clean-set/-/clean-set-0.0.1.tgz","integrity":"sha512-gyUzqe7KhFMJ7vn1R22nu1fLkKCuhw7xcbc8xpYIyY48v+BRkl+pNKv4F/R05eDOSEp4SeJYad8ZeavcAQoUrg=="},"maintainers":[{"name":"anonymous","email":"frank.wilkerson@outlook.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/clean-set_0.0.1_1528264293945_0.897545697575999"},"_hasShrinkwrap":false,"publish_time":1528264294072,"_cnpm_publish_time":1528264294072,"_cnpmcore_publish_time":"2021-12-16T20:21:59.987Z","contributors":[]}},"dist-tags":{"latest":"1.1.2"},"name":"clean-set","time":{"created":"2022-01-27T20:14:03.967Z","modified":"2023-07-26T18:28:18.126Z","1.1.2":"2020-05-15T05:30:12.533Z","1.1.1":"2019-03-17T03:21:27.552Z","1.1.0":"2018-06-21T21:39:07.846Z","1.0.0":"2018-06-06T07:16:33.046Z","0.0.1":"2018-06-06T05:51:34.072Z"},"readme":"# clean-set\r\n\r\n[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)\r\n[![Build Status](https://travis-ci.org/fwilkerson/clean-set.svg?branch=master)](https://travis-ci.org/fwilkerson/clean-set)\r\n[![codecov](https://codecov.io/gh/fwilkerson/clean-set/branch/master/graph/badge.svg)](https://codecov.io/gh/fwilkerson/clean-set)\r\n\r\n> Quickly update a value in a deeply nested object and clone each node touched for simple change tracking `===`.\r\n\r\nCheck out [dset](https://github.com/lukeed/dset) if you just want to do an in place mutation on a deeply nested value.\r\n\r\n## Install\r\n\r\n> npm i clean-set\r\n\r\nIncludes builds for commonjs, umd, and esm and is less than ~~200b~~ 182b gzip (thanks to [@lukeed](https://github.com/lukeed))\r\n\r\n## Usage\r\n\r\n```javascript\r\nlet current = {\r\n  a: { b: [], c: true },\r\n  d: [],\r\n  e: {\r\n    f: { g: 'hello' },\r\n    h: { i: 0 },\r\n  },\r\n};\r\n\r\nlet next = cleanSet(current, 'e.h.i', 1);\r\n\r\n/**\r\n * Alternatively you can provide a function for the final parameter to\r\n * receive the current value of that node.\r\n *\r\n * let next = cleanSet(current, 'e.h.i', i => i + 1);\r\n */\r\n\r\n// The value is assigned\r\nconsole.log(next.e.h.i !== current.e.h.i); // true\r\n\r\n// Each parent node touched is a new reference\r\nconsole.log(next.e.h !== current.e.h); // true\r\nconsole.log(next.e !== current.e); // true\r\nconsole.log(next !== current); // true\r\n\r\n// Untouched references remain the same\r\nconsole.log(next.e.f === current.e.f); // true\r\nconsole.log(next.a === current.a); // true\r\nconsole.log(next.a.b === current.a.b); // true\r\nconsole.log(next.d === current.d); // true\r\n```\r\n\r\nHere's what an object spread equivalent would look like.\r\n\r\n```javascript\r\nlet next = {\r\n  ...current,\r\n  e: {\r\n    ...current.e,\r\n    h: { ...current.e.h, i: 1 },\r\n  },\r\n};\r\n```\r\n\r\n## Benchmarks\r\n\r\nCheck out the [es bench link](https://esbench.com/bench/5b16f1cbf2949800a0f61cf2) to run the benchmarks yourself.\r\n\r\n> Note: YMMV canary and firefox dev have some impressive improvements for object assign and object spread respectively.\r\n\r\nChrome 67\r\n\r\n<img src=\"./assets/chrome_67.png\">","users":{}}