{"name":"@putout/plugin-convert-object-entries-to-array-entries","version":"3.0.2","type":"commonjs","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/plugin-split-variable-declarations":"*","@putout/test":"^11.0.0","c8":"^10.0.0","eslint":"^9.0.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^23.0.0","madrun":"^10.0.0"},"peerDependencies":{"putout":">=31"},"license":"MIT","engines":{"node":">=16"},"publishConfig":{"access":"public"},"_id":"@putout/plugin-convert-object-entries-to-array-entries@3.0.2","gitHead":"2404b226d91d144d02362ba89f6cdf2f2752dec8","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_nodeVersion":"22.12.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-S3U6C1vAUS272TGYrAeWz2UJA2jPn8H7qBJ2IzgI1kAycO1IXnOyFn3iuBLC9pY2ireehVC1TKVrZMkC2b6NZQ==","shasum":"ab6bc1ddcfc1e5f660651cc76caa548c702c7775","tarball":"http://registry-npm.ywwl.com/@putout/plugin-convert-object-entries-to-array-entries/download/@putout/plugin-convert-object-entries-to-array-entries-3.0.2.tgz","fileCount":4,"unpackedSize":5425,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE/pc42trFIPWlFEFP0Ru1kb82e6GZhWBp+ogKqe5g9kAiBYkJogm1YgawVsDPA5RQfg9wDfMj+7bctdvrbkhp07mw=="}],"size":2482,"noattachment":false,"key":"/@putout/plugin-convert-object-entries-to-array-entries/-/@putout/plugin-convert-object-entries-to-array-entries-3.0.2.tgz"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/plugin-convert-object-entries-to-array-entries_3.0.2_1736163303162_0.6637175629403318"},"_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":1736163303323,"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"_cnpm_publish_time":1736163303323,"dist-tags":{"latest":"4.0.0"}}