{"_id":"@putout/plugin-apply-flat-map","_rev":"4159258","name":"@putout/plugin-apply-flat-map","description":"🐊Putout plugin adds ability to apply 'flatMap()'","dist-tags":{"latest":"3.0.0"},"maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"time":{"modified":"2026-03-01T20:34:36.000Z","created":"2023-01-06T11:15:02.212Z","3.0.0":"2025-04-01T13:46:15.220Z","2.0.0":"2023-01-30T18:07:20.543Z","1.0.0":"2023-01-06T11:15:02.212Z"},"users":{},"author":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com","url":"https://github.com/coderaiser"},"repository":{"type":"git","url":"git+https://github.com/coderaiser/putout.git"},"versions":{"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":{"shasum":"c86e0d92cbef4af0b66dd82f465e6bc134b50450","size":2213,"noattachment":false,"key":"/@putout/plugin-apply-flat-map/-/@putout/plugin-apply-flat-map-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@putout/plugin-apply-flat-map/download/@putout/plugin-apply-flat-map-3.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-apply-flat-map_3.0.0_1743515175042_0.606790258987554"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2025-04-01T13:46:15.220Z","publish_time":1743515175220,"_source_registry_name":"default","_cnpm_publish_time":1743515175220},"2.0.0":{"name":"@putout/plugin-apply-flat-map","version":"2.0.0","type":"commonjs","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","commitType":"colon","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","putout-plugin-apply","plugin","flat-map"],"devDependencies":{"@putout/test":"^5.0.0","c8":"^7.5.0","eslint":"^8.0.1","eslint-plugin-n":"^15.2.4","eslint-plugin-putout":"^16.0.0","lerna":"^6.0.1","madrun":"^9.0.0","nodemon":"^2.0.1"},"peerDependencies":{"putout":">=28"},"license":"MIT","engines":{"node":">=16"},"publishConfig":{"access":"public"},"gitHead":"77512b01b6f5b9bb34f7b75c968b3792b96d6128","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_id":"@putout/plugin-apply-flat-map@2.0.0","_nodeVersion":"18.13.0","_npmVersion":"9.1.3","dist":{"shasum":"d2da79b1e202d78261b3552f17fd632a877fd1af","size":2235,"noattachment":false,"key":"/@putout/plugin-apply-flat-map/-/@putout/plugin-apply-flat-map-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@putout/plugin-apply-flat-map/download/@putout/plugin-apply-flat-map-2.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","tmp":"tmp/plugin-apply-flat-map_2.0.0_1675102040333_0.4367832179361384"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-01-30T18:07:20.543Z","publish_time":1675102040543,"_cnpm_publish_time":1675102040543},"1.0.0":{"name":"@putout/plugin-apply-flat-map","version":"1.0.0","type":"commonjs","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","commitType":"colon","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","putout-plugin-apply","plugin","flat-map"],"devDependencies":{"@putout/test":"^5.0.0","c8":"^7.5.0","eslint":"^8.0.1","eslint-plugin-n":"^15.2.4","eslint-plugin-putout":"^16.0.0","lerna":"^6.0.1","madrun":"^9.0.0","nodemon":"^2.0.1"},"peerDependencies":{"putout":">=25"},"license":"MIT","engines":{"node":">=16"},"publishConfig":{"access":"public"},"gitHead":"02441fac6cc0a0ea55c602331eaca41a15d395cf","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"_id":"@putout/plugin-apply-flat-map@1.0.0","_nodeVersion":"18.12.1","_npmVersion":"9.1.3","dist":{"shasum":"46c41c401a810241c2de34c5d18e66f97a244db6","size":2249,"noattachment":false,"key":"/@putout/plugin-apply-flat-map/-/@putout/plugin-apply-flat-map-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@putout/plugin-apply-flat-map/download/@putout/plugin-apply-flat-map-1.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","tmp":"tmp/plugin-apply-flat-map_1.0.0_1673003701914_0.5584575142978545"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-01-06T11:34:40.977Z","publish_time":1673003702212,"_cnpm_publish_time":1673003702212}},"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","_attachments":{},"homepage":"http://github.com/coderaiser/putout/tree/master/packages/plugin-apply-flat-map#readme","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"license":"MIT"}