{"name":"@putout/plugin-apply-destructuring","version":"10.0.0","keywords":["putout","putout-plugin","plugin","destructuring"],"author":{"url":"https://github.com/coderaiser","name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"license":"MIT","_id":"@putout/plugin-apply-destructuring@10.0.0","maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-apply-destructuring#readme","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"tag":false,"dist":{"shasum":"abd680eb2b37fbf0e60519682638910717f74144","tarball":"http://registry-npm.ywwl.com/@putout/plugin-apply-destructuring/download/@putout/plugin-apply-destructuring-10.0.0.tgz","fileCount":7,"integrity":"sha512-UDfsCiL86AcfBk6r9VF6X4rZHLTHaYSnsxeX0KPEPcOU/8GnknX/qJzk+AVNZOAm1sFORhfksMrjdqPx/RQrZg==","signatures":[{"sig":"MEUCIQCtpBzA8Q4IZj0mg1M8aqVEg3h6WPE6IVkpKpYKQkk1IwIgEF/KaKh848+AdJwqkmaHrBS9bTbVaSGu+mC3j6NoHEw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5870,"size":2680,"noattachment":false,"key":"/@putout/plugin-apply-destructuring/-/@putout/plugin-apply-destructuring-10.0.0.tgz"},"main":"lib/index.js","type":"module","engines":{"node":">=20"},"gitHead":"db0e4f0a10379664289fdce9e36b78944f7b583b","release":false,"scripts":{"lint":"madrun lint","test":"madrun test","report":"madrun report","coverage":"madrun coverage","fix:lint":"madrun fix:lint","fresh:lint":"madrun fresh:lint","lint:fresh":"madrun lint:fresh","watch:test":"madrun watch:test"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"changelog":false,"repository":{"url":"git+https://github.com/coderaiser/putout.git","type":"git"},"_npmVersion":"11.4.2","description":"🐊Putout plugin adds ability use destructuring on variable declarations","directories":{},"_nodeVersion":"24.8.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.0.0","eslint":"^9.0.0","madrun":"^11.0.0","nodemon":"^3.0.1","@putout/test":"^14.0.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^28.0.0"},"peerDependencies":{"putout":">=40"},"_npmOperationalInternal":{"tmp":"tmp/plugin-apply-destructuring_10.0.0_1758122372333_0.3013065975162603","host":"s3://npm-registry-packages-npm-production"},"readme":"# @putout/plugin-apply-destructuring [![NPM version][NPMIMGURL]][NPMURL]\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-apply-destructuring.svg?style=flat&longCache=true\n[NPMURL]: https://npmjs.org/package/@putout/plugin-apply-destructuring\"npm\"\n\n> The **destructuring** assignment syntax is a **JavaScript** expression that makes it possible to unpack values from arrays, or properties from objects, into distinct variables.\n>\n> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment)\n\n🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to use **destructuring** on variable declarations. Renamed to [`@putout/plugin-destructuring`](https://www.npmjs.com/package/@putout/plugin-destructuring).\n\n## Install\n\n```\nnpm i @putout/plugin-apply-destructuring\n```\n\n## Rules\n\n- ✅ [object](#object);\n- ✅ [array](#array);\n- ✅ [falsy](#falsy);\n- ✅ [convert-object-to-array](#convert-object-to-array);\n\n## Config\n\nShort:\n\n```json\n{\n    \"rules\": {\n        \"apply-destructuring\": \"on\"\n    }\n}\n```\n\nFull:\n\n```json\n{\n    \"rules\": {\n        \"apply-destructuring/object\": \"on\",\n        \"apply-destructuring/array\": \"on\",\n        \"apply-destructuring/falsy\": \"on\"\n    }\n}\n```\n\n## array\n\n## ❌ Example of incorrect code\n\n```js\nconst first = array[0];\n```\n\n## ✅ Example of correct code\n\n```js\nconst [first] = array;\n```\n\n## object\n\n## ❌ Example of incorrect code\n\n```js\nconst name = user.name;\n\nhello = world.hello;\n```\n\n## ✅ Example of correct code\n\n```js\nconst {name} = user;\n\n({hello} = world);\n```\n\n## falsy\n\nCheck out in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/c9ed04b421d75ae39e58038fa6e14630/4c097e3173990ec7e5ebabbe2cedf8e952092ebf).\n\n## ❌ Example of incorrect code\n\n```js\nconst {maxElementsInOneLine} = {\n    options,\n};\n```\n\n## ✅ Example of correct code\n\n```js\nconst {maxElementsInOneLine} = options;\n```\n\n## convert-object-to-array\n\nCheck out in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/a1d26daf8bb83ee3ea1c0b62a6ad3afd/cef9b4d27c9dbb0d413a935b0359a6fe9b50364f).\n\n## ❌ Example of incorrect code\n\n```js\nconst {0: a, 1: b} = c;\n```\n\n## ✅ Example of correct code\n\n```js\nconst [a, b] = c;\n```\n\n## License\n\nMIT\n","publish_time":1758122372522,"_cnpm_publish_time":1758122372522,"dist-tags":{"latest":"10.1.1"}}