{"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":"http://registry-npm.ywwl.com/@putout/plugin-apply-flat-map/download/@putout/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="}],"size":2213,"noattachment":false,"key":"/@putout/plugin-apply-flat-map/-/@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,"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","publish_time":1743515175220,"_cnpm_publish_time":1743515175220,"dist-tags":{"latest":"3.0.0"}}