Files
2025-11-28 19:45:44 -07:00

13 lines
370 B
JavaScript

import { flatten } from './flatten.mjs';
import { limitAsync } from './limitAsync.mjs';
async function flatMapAsync(array, callback, options) {
if (options?.concurrency != null) {
callback = limitAsync(callback, options.concurrency);
}
const results = await Promise.all(array.map(callback));
return flatten(results);
}
export { flatMapAsync };