{"name":"@putout/plugin-convert-object-entries-to-array-entries","version":"4.0.0","type":"module","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"🐊Putout plugin adds ability to convert 'const' to 'let'","homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-convert-object-entries-to-array-entries#readme","main":"lib/convert-object-entries-to-array-entries.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","convert","const","let","var","VariableDeclaration"],"devDependencies":{"@putout/eslint-flat":"^4.0.0","@putout/test":"^15.0.0","c8":"^10.0.0","eslint":"^10.0.0-alpha.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^30.0.0","madrun":"^12.0.0"},"peerDependencies":{"putout":">=41"},"license":"MIT","engines":{"node":">=22"},"publishConfig":{"access":"public"},"_id":"@putout/plugin-convert-object-entries-to-array-entries@4.0.0","gitHead":"2690290b766e88453ea42c6c4689442eeb52b90e","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_nodeVersion":"25.5.0","_npmVersion":"11.4.2","dist":{"integrity":"sha512-mUhctxNsp9+iXzt8Of8dxM+vlR7Cog4BE+H/l3r5IUPB6k1dcdtPHvDqbgjE56VOHt+DM8b/j2UFNXSQcbYgCQ==","shasum":"6bfb980cc0e5ba9a64c8c3ac736d957a65f812f0","tarball":"http://registry-npm.ywwl.com/@putout/plugin-convert-object-entries-to-array-entries/download/@putout/plugin-convert-object-entries-to-array-entries-4.0.0.tgz","fileCount":4,"unpackedSize":5393,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDoIz3NiHap7Cn2xw5XwpUSRdRtL8ozaR5I/8He8wqXSQIgAp5yRoZRp5gGswo53M1QBnhAmMl7NiQjkrpwaOsnnAQ="}],"size":2462,"noattachment":false,"key":"/@putout/plugin-convert-object-entries-to-array-entries/-/@putout/plugin-convert-object-entries-to-array-entries-4.0.0.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-convert-object-entries-to-array-entries_4.0.0_1769633110223_0.7347105904681335"},"_hasShrinkwrap":false,"readme":"# @putout/plugin-convert-object-entries-to-array-entries [![NPM version][NPMIMGURL]][NPMURL]\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-convert-object-entries-to-array-entries.svg?style=flat&longCache=true\n[NPMURL]: https://npmjs.org/package/@putout/plugin-convert-object-entries-to-array-entries \"npm\"\n\n> The `Object.entries()` static method returns an array of a given object's own enumerable string-keyed property key-value pairs.\n>\n> (c) [`Object.entries()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries)\n\n> The `entries()` method returns a new `Array Iterator` object that contains the key/value pairs for each index in the array.\n>\n> (c) [`Array.prototype.entries()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries)\n\n🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to convert `Object.entries()` to `Array.prototype.entries()` to avoid bugs\nrelated to using `index` in unary (`!index`) or binary (`index > length`) expressions, the thing is `Object.entries()` returns list of `Array<String, any>` tuples,\nand `Array.prototype.entries()` returns list of `Array<Number, any>` tuples it can lead to bugs when you expected that `index` is number.\n\nCheck out in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/f902e1f52d551545cede97db4cfba345/dbae8bfd2c4b0b4ec9612e2002a87c2a5961204d).\n\n## Install\n\n```\nnpm i @putout/plugin-convert-object-entries-to-array-entries -D\n```\n\n## Rule\n\n```json\n{\n    \"rules\": {\n        \"convert-object-entries-to-array-entries\": \"on\"\n    }\n}\n```\n\n## ❌ Example of incorrect code\n\n```js\nconst {entries} = Object;\n\nfor (const [i, token] of entries(tokens)) {\n    if (!i)\n        continue;\n    \n    fn(token);\n}\n```\n\n## ✅ Example of correct code\n\n```js\nfor (const [i, token] of tokens.entries()) {\n    if (!i)\n        continue;\n    \n    fn(token);\n}\n```\n\n## License\n\nMIT\n","publish_time":1769633110363,"_cnpm_publish_time":1769633110363,"dist-tags":{"latest":"4.0.0"}}