{"name":"@putout/plugin-convert-for-in-to-for-of","version":"2.0.1","type":"commonjs","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"🐊Putout plugin adds ability to convert for-in to for-of","homepage":"https://github.com/coderaiser/putout/tree/v28.19.2/packages/plugin-convert-for-in-to-for-of#readme","main":"lib/convert-for-in-to-for-of.js","release":false,"tag":false,"changelog":false,"repository":{"type":"git","url":"git://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","convert","for-in","for-of"],"devDependencies":{"@putout/test":"^6.0.0","c8":"^7.5.0","eslint":"^8.0.1","eslint-plugin-n":"^15.2.4","eslint-plugin-putout":"^16.0.0","madrun":"^9.0.0"},"peerDependencies":{"putout":">=9"},"license":"MIT","engines":{"node":">=10"},"publishConfig":{"access":"public"},"gitHead":"6bbff109c4ce2bbdddad0500f27a762477aa60da","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_id":"@putout/plugin-convert-for-in-to-for-of@2.0.1","_nodeVersion":"18.14.2","_npmVersion":"9.1.3","dist":{"integrity":"sha512-CjDXgIyF+YptMUbVsKS6SyJUbn41YuVQkVF/gMYS3rPC/3XwnTLMT0+oZsqsmd5Il213p1TgKsixb2jnJqTHuQ==","shasum":"495dad7bcbd22e6157f411ccd6c6e6eed3381350","tarball":"http://registry-npm.ywwl.com/@putout/plugin-convert-for-in-to-for-of/download/@putout/plugin-convert-for-in-to-for-of-2.0.1.tgz","fileCount":6,"unpackedSize":6090,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICSAusQpcaPHRdhNWH32CmLD1ZQCYNbFXarcJt+tHYtvAiBlbF+XYvK11oW/zvcuTm8Xdxa+qCGFJARqBMla7ilkjg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkDOfnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpJ6Q/9HKEbPHuYiog/0L1ikMtSrOSW7ny2EIICtRPOLQNkWdf8P4UZ\r\nsCRjmUnhOkOtbYslez25zCY1bgRqoU9LDpOnmz9/3jQoSKnt9mfK8FHfCzJ3\r\nf4UssWyr+YTdiwFI853p5Rk062h3JcIjoUGiuWBO4k1gHLAvUU5mtJeVqIco\r\n4SsY5He6oWgMvJFaSxZFp7cBH0Ec81XWFayN8Ksv3h4EbPDdC4NvG2FefHJT\r\ntjg/U+VxBReqonTryxL3sSBDDOOq970AFCs7QyIPF/G1o5tZYXyLFzaEgkVk\r\nHfNNNeP5cX++K6o5U8BtN86YAAFMOGALsKHMgeG7iTGwCaLtSQs9O5oAWS9O\r\nUN24oqrVwN43bmDl5BhiFL3lY8Da6BnqKHst01JyWAbQuNA6ZGElgL7eivsA\r\n9D9VKjDiMqZLrKWjsnlmCrsvEb+LRzGCA6ZS9IFTnrn1/puATvWegJlYu5ZU\r\nctE5JMZYTF7ampCV7lHFd4AekZP346JhopWBLWVP0jGzPYjlCJan5Cq6A1WO\r\nshYFuOhuLXObfJu2enCOiPdzKJ/ulJy2c3y+1C65Y0SOsatxyMeJDTmySnwz\r\nLbqrV+2F2ii7TvgXSd6QqVapYfYaVJkhJVYq8KWIiS8yoLqPblPwEn7BtNzl\r\nMpr4/vI1YFKcoMVgFVI9TIljvx62VSrb7Vs=\r\n=1xW/\r\n-----END PGP SIGNATURE-----\r\n","size":2429,"noattachment":false,"key":"/@putout/plugin-convert-for-in-to-for-of/-/@putout/plugin-convert-for-in-to-for-of-2.0.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","tmp":"tmp/plugin-convert-for-in-to-for-of_2.0.1_1678567399064_0.30662711771981765"},"_hasShrinkwrap":false,"readme":"# @putout/plugin-convert-for-in-to-for-of [![NPM version][NPMIMGURL]][NPMURL]\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-convert-for-in-to-for-of.svg?style=flat&longCache=true\n[NPMURL]: https://npmjs.org/package/@putout/plugin-convert-for-in-to-for-of \"npm\"\n\n> The [`for...in`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...in) statement iterates over all enumerable properties of an object that are keyed by strings.\n>\n> The [`for...of`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of) statement creates a loop which invokes a custom iteration hook with statements to be executed for the value of each element of an array.\n>\n> (c) MDN\n\n🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to convert `for...in` to `for...of` loop. Merged to [`@putout/plugin-for-of`](https://www.npmjs.com/package/@putout/plugin-for-of).\n\n## Install\n\n```\nnpm i @putout/plugin-convert-for-in-to-for-of -D\n```\n\n## Rule\n\n```json\n{\n    \"rules\": {\n        \"convert-for-in-to-for-of/positive\": \"on\",\n        \"convert-for-in-to-for-of/negative\": \"on\"\n    }\n}\n```\n\n## ❌ Example of incorrect code\n\n```js\nfor (const item in object) {\n    if (object.hasOwnProperty(item)) {\n        log(item);\n    }\n}\n\nfor (const item in object) {\n    if (!object.hasOwnProperty(item))\n        continue;\n    \n    log(item);\n}\n```\n\n## ✅ Example of correct code\n\n```js\nfor (const item of Object.keys(object)) {\n    log(item);\n}\n```\n\n## License\n\nMIT\n","publish_time":1678567399227,"_cnpm_publish_time":1678567399227,"dist-tags":{"latest":"2.0.1"}}