{"name":"@putout/plugin-apply-destructuring","version":"10.1.1","type":"module","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"🐊Putout plugin adds ability use destructuring on variable declarations","homepage":"https://github.com/coderaiser/putout/tree/v40.15.1/packages/plugin-apply-destructuring#readme","main":"lib/index.js","release":false,"tag":false,"changelog":false,"repository":{"type":"git","url":"git+https://github.com/coderaiser/putout.git"},"scripts":{"test":"madrun test","watch:test":"madrun watch:test","lint":"madrun lint","fresh:lint":"madrun fresh:lint","lint:fresh":"madrun lint:fresh","fix:lint":"madrun fix:lint","coverage":"madrun coverage","report":"madrun report"},"dependencies":{},"keywords":["putout","putout-plugin","plugin","destructuring"],"devDependencies":{"@putout/test":"^14.0.0","c8":"^10.0.0","eslint":"^9.0.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^28.0.0","madrun":"^11.0.0","nodemon":"^3.0.1"},"peerDependencies":{"putout":">=40"},"license":"MIT","engines":{"node":">=20"},"publishConfig":{"access":"public"},"_id":"@putout/plugin-apply-destructuring@10.1.1","gitHead":"2f6133764c3b7cb020b72a63166efece1f584727","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_nodeVersion":"25.2.1","_npmVersion":"11.4.2","dist":{"integrity":"sha512-nRCjm3JJswdhHwR9pUqCkq657M18eKCGEknaHcyINn61cCkSfy7PSwnHyW5VHqO7LCHwLgn6FKoF+ZQs+lx8lQ==","shasum":"a119feda393ebca4aae77b807b67fb94a653ed08","tarball":"http://registry-npm.ywwl.com/@putout/plugin-apply-destructuring/download/@putout/plugin-apply-destructuring-10.1.1.tgz","fileCount":8,"unpackedSize":7397,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIF2bSbLrAf2nfZUWAZX1Z4VCgW6KNZUmuhcXBJEHsITDAiEA5+uguns4tljnCMS1hyxdHaUBDfui5B+bKZJP2OAaAQM="}],"size":3119,"noattachment":false,"key":"/@putout/plugin-apply-destructuring/-/@putout/plugin-apply-destructuring-10.1.1.tgz"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"directories":{},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/plugin-apply-destructuring_10.1.1_1764370357003_0.28003491094181254"},"_hasShrinkwrap":false,"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":1764370357193,"_cnpm_publish_time":1764370357193,"dist-tags":{"latest":"10.1.1"}}