source: node_modules/es-toolkit/dist/array/flatMapAsync.mjs

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 370 bytes
Line 
1import { flatten } from './flatten.mjs';
2import { limitAsync } from './limitAsync.mjs';
3
4async function flatMapAsync(array, callback, options) {
5 if (options?.concurrency != null) {
6 callback = limitAsync(callback, options.concurrency);
7 }
8 const results = await Promise.all(array.map(callback));
9 return flatten(results);
10}
11
12export { flatMapAsync };
Note: See TracBrowser for help on using the repository browser.