{"_id":"@putout/plugin-apply-flat-map","_rev":"3-90590bf42b797ae6e7b1591906290036","name":"@putout/plugin-apply-flat-map","dist-tags":{"latest":"3.0.0"},"versions":{"1.0.0":{"name":"@putout/plugin-apply-flat-map","version":"1.0.0","keywords":["putout","putout-plugin","putout-plugin-apply","plugin","flat-map"],"author":{"url":"https://github.com/coderaiser","name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"license":"MIT","_id":"@putout/plugin-apply-flat-map@1.0.0","maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"homepage":"http://github.com/coderaiser/putout/tree/master/packages/plugin-apply-flat-map#readme","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"tag":false,"dist":{"shasum":"46c41c401a810241c2de34c5d18e66f97a244db6","tarball":"https://registry.npmjs.org/@putout/plugin-apply-flat-map/-/plugin-apply-flat-map-1.0.0.tgz","fileCount":4,"integrity":"sha512-szM1RN7Z/xoJ8+07h6zf73VZd7D49V9uVdyQzx9pYyHgTSfIYfaCwMWRkFMsYqZyiYdzLngeO4xGm1LHoDyXjw==","signatures":[{"sig":"MEUCIQDwSLcAMQONRedhhqHftoSaKVXyLQQa8V5FqWdXML1kMAIgbeoz2oef9kSmqE1LFAoO09639UgTmYyL6c4GQ2d4vmU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4293,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjuAK2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq+Aw/+OpkJJa7QDpHAqFyTkrrjmTPxlYmu0aIuHe/I0MofoU6O1MF+\r\nmqQh5jiYFQwUjSJZfGoxjpyjMH0dk9MoRLCPjCedqQFaK+plxUe7PhLyDxVA\r\nHvuUFLWiJIGFRtuKerNE9qwOPQUmNegFj6BWJfsvPuXGZq0jgcDXXTyLQooI\r\n2maLhndmd8m7sEA0gTRJx7PsrNhDSyQnV7mp4nMvxULcxnLf8vyBMp3O0gnK\r\nnqB6r9focTQPTfAGJYtJzzUZDj+HYDRMCrK6rs5tQCrGFI3ly3lbyTykHVQJ\r\nnEnFKPlwsWrKaQkRqeO0et+ixIWAy4+TuI0kffak0Z53yNmW8SK260XfuYZV\r\nN29AGsIPw41Oj0qRrmtqh0Jb8mdDFTGZAChQ+1cicboxjZqbQEL4OFdunxiB\r\nqwh8xMgQe9SWgiXlPHdIWApgMM7Y8+b0uBVr3BvGYuk/iuGaj49zmNpx4hOo\r\n9C2Y7UpJcGsA8cib/BpSKtc41YN9rLaPTUyw/0+aVum8jLq4iskXyDLPklR/\r\nrgRPcwtpt0whyEEcKMwO2a0q3ejrZNgvFlX2fy0opvkS5dOaNl+C+FMBbBSn\r\nEAGjIRzDYbUeBtLY8PQuVMX67NvPd8eeBVXVljPhSwdIO6Zzjx5h9wUONqnG\r\nTRcza3kKsr/0ljMRtBn3G9rUFyHPmsIPo5I=\r\n=TJWZ\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/apply-flat-map.js","type":"commonjs","engines":{"node":">=16"},"gitHead":"02441fac6cc0a0ea55c602331eaca41a15d395cf","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,"commitType":"colon","repository":{"url":"git://github.com/coderaiser/putout.git","type":"git"},"_npmVersion":"9.1.3","description":"🐊Putout plugin adds ability to apply flatMap()","directories":{},"_nodeVersion":"18.12.1","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^7.5.0","lerna":"^6.0.1","eslint":"^8.0.1","madrun":"^9.0.0","nodemon":"^2.0.1","@putout/test":"^5.0.0","eslint-plugin-n":"^15.2.4","eslint-plugin-putout":"^16.0.0"},"peerDependencies":{"putout":">=25"},"_npmOperationalInternal":{"tmp":"tmp/plugin-apply-flat-map_1.0.0_1673003701914_0.5584575142978545","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"@putout/plugin-apply-flat-map","version":"2.0.0","keywords":["putout","putout-plugin","putout-plugin-apply","plugin","flat-map"],"author":{"url":"https://github.com/coderaiser","name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"license":"MIT","_id":"@putout/plugin-apply-flat-map@2.0.0","maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"homepage":"http://github.com/coderaiser/putout/tree/master/packages/plugin-apply-flat-map#readme","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"tag":false,"dist":{"shasum":"d2da79b1e202d78261b3552f17fd632a877fd1af","tarball":"https://registry.npmjs.org/@putout/plugin-apply-flat-map/-/plugin-apply-flat-map-2.0.0.tgz","fileCount":4,"integrity":"sha512-TH+Al9LJqKZeyrh1Yg2/lwmIXdpZx6yINTf6vtCa1cdd5ebCAe6hGbU7VttZMcQzFCWZwqJX2BCPKtSr+4RAwA==","signatures":[{"sig":"MEUCIHS+chDN4oGDQUGM2THrwc5bICqAf596K1iZmWiY5dO6AiEAkbtwZhlCdlemjZKuGWgLctunQ6o47wnRKF3vWRkLC94=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4293,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj2AdYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrQcw/8DJToM7k+0w2dZxFzJC/giKMmmlGYqQZV27spijiDGIc2yCzr\r\nxkJlWeze0RQRDKFdMOkpUPaKA/38q5Ms+g3ONJHbiph1vhebA14zjEXdGxcf\r\nDu66mB+XFtSrXbMIKNC1kg8shnRjF4nOlz0WobND0QjE2WS8zmVaDmnbiIAR\r\nNZHnhhiwX6pQeWXPzzasK/f/HDc9xutzPeDT/x4oP1fbA/kb9GQJzY7+rSVu\r\nlktGUZLawgChdZ72A0Rw2ZuvRf4jELxrWE6N7XosMyOtBHnLYLm4hvJVQPuw\r\npTogow9Ms96OSd1yqcHMJzNcap4ROr1BQPm1sAmdOMF23yBSlRyS8QORO309\r\nWCQRrLNPhYwLvgc8SFG+SABhCOEB+Y/JwVOUbAwfsZcp65tAyqhiyM7kXlfb\r\neG3D6or6vt8Bn06pQawHmJyxzKs1Tr27BzGCYEek+fX3wdKr0IYJ0EKbIbNm\r\nY5E1+rUEKvpxJEgexJcSMYjwP1CPaS2HbMwWQ/n31YSggEy8YCqK8LAgfZQx\r\nh0zf7Ic2mDdlWA2CI4XI+oUCxJNybAQYUowlDCtaw1elMu0d6u+0Wd6LbrOC\r\n2JPzuTB3k0PJb50tZRDROYle63DSGm8JU9AnxhVNrUQDta6YJoyJ2urg3MOF\r\nYYrQsuq4rvNhVHazm2+bIb8TH586nU3sGtQ=\r\n=LcNN\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/apply-flat-map.js","type":"commonjs","engines":{"node":">=16"},"gitHead":"77512b01b6f5b9bb34f7b75c968b3792b96d6128","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,"commitType":"colon","repository":{"url":"git://github.com/coderaiser/putout.git","type":"git"},"_npmVersion":"9.1.3","description":"🐊Putout plugin adds ability to apply 'flatMap()'","directories":{},"_nodeVersion":"18.13.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^7.5.0","lerna":"^6.0.1","eslint":"^8.0.1","madrun":"^9.0.0","nodemon":"^2.0.1","@putout/test":"^5.0.0","eslint-plugin-n":"^15.2.4","eslint-plugin-putout":"^16.0.0"},"peerDependencies":{"putout":">=28"},"_npmOperationalInternal":{"tmp":"tmp/plugin-apply-flat-map_2.0.0_1675102040333_0.4367832179361384","host":"s3://npm-registry-packages"}},"3.0.0":{"name":"@putout/plugin-apply-flat-map","version":"3.0.0","type":"module","author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"description":"🐊Putout plugin adds ability to apply 'flatMap()'","homepage":"http://github.com/coderaiser/putout/tree/master/packages/plugin-apply-flat-map#readme","main":"lib/apply-flat-map.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","putout-plugin-apply","plugin","flat-map"],"devDependencies":{"@putout/test":"^13.0.0","c8":"^10.0.0","eslint":"^9.0.0","eslint-plugin-n":"^17.0.0","eslint-plugin-putout":"^26.0.0","madrun":"^11.0.0","nodemon":"^3.0.1"},"peerDependencies":{"putout":">=39"},"license":"MIT","engines":{"node":">=20"},"publishConfig":{"access":"public"},"_id":"@putout/plugin-apply-flat-map@3.0.0","gitHead":"9d9cf9aedda078ce28bd93e2666281e4400eadc0","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_nodeVersion":"20.19.0","_npmVersion":"11.1.0","dist":{"integrity":"sha512-sezkHHX87McHsQo1h814HroscWb+ul8X/tVtB/Y0OWugjvjqq2T7RE9o2skceCZ6zFN4xc/WL4VWGTfWwRIoyg==","shasum":"c86e0d92cbef4af0b66dd82f465e6bc134b50450","tarball":"https://registry.npmjs.org/@putout/plugin-apply-flat-map/-/plugin-apply-flat-map-3.0.0.tgz","fileCount":4,"unpackedSize":4242,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDe0ZgsCBsZY21yjr4/fz+QRAouiZHSRdDlKMAQl95Y7gIgTvFDS/I0c7hyKpz1CFA4/sPwj1K2orcYbkwy6cwH+8g="}]},"_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-flat-map_3.0.0_1743515175042_0.606790258987554"},"_hasShrinkwrap":false}},"time":{"created":"2023-01-06T11:15:01.838Z","modified":"2025-04-01T13:46:15.426Z","1.0.0":"2023-01-06T11:15:02.212Z","2.0.0":"2023-01-30T18:07:20.543Z","3.0.0":"2025-04-01T13:46:15.220Z"},"bugs":{"url":"https://github.com/coderaiser/putout/issues"},"author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"license":"MIT","homepage":"http://github.com/coderaiser/putout/tree/master/packages/plugin-apply-flat-map#readme","keywords":["putout","putout-plugin","putout-plugin-apply","plugin","flat-map"],"repository":{"type":"git","url":"git+https://github.com/coderaiser/putout.git"},"description":"🐊Putout plugin adds ability to apply 'flatMap()'","maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"readme":"# @putout/plugin-apply-flat-map [![NPM version][NPMIMGURL]][NPMURL]\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-apply-flat-map.svg?style=flat&longCache=true\n[NPMURL]: https://npmjs.org/package/@putout/plugin-apply-flat-map \"npm\"\n\n> The `flatMap()` method returns a new array formed by applying a given callback function to each element of the array, and then flattening the result by one level.\n> It is identical to a `map()` followed by a `flat()` of depth 1 (`arr.map(...args).flat()`), but slightly more efficient than calling those two methods separately.\n>\n> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap)\n\n🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to apply `flatMap()`. Check out in [🐊**Putout Editor**](https://putout.cloudcmd.io/#/gist/0d3d44937de69ca266c4a11be5152eac/86af6566f93434ef86fdca919e57eaac7361a706).\n\n## Install\n\n```\nnpm i @putout/plugin-apply-flat-map\n```\n\n## Rule\n\n```json\n{\n    \"rules\": {\n        \"apply-flat-map\": \"on\"\n    }\n}\n```\n\n## ❌ Example of incorrect code\n\n```js\narray\n    .map(getId)\n    .flat();\n```\n\n## ✅ Example of correct code\n\n```js\narray.flatMap(getId);\n```\n\n## Comparison\n\nLinter | Rule | Fix\n--------|-------|------------|\n🐊 **Putout** | [`apply-flat-map`](https://github.com/coderaiser/putout/tree/master/packages/plugin-apply-flat-map#readme) | ✅\n⏣ **ESLint** | [`unicorn/prefer-flat-map`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-array-flat-map.md) | ✅\n🏛 **Rome** | [`useFlatMap`](https://docs.rome.tools/lint/rules/useflatmap/) | ✅\n\n## License\n\nMIT\n","readmeFilename":"README.md"}