es-toolkit
Version:
A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.
15 lines (10 loc) • 396 B
JavaScript
;
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const limitAsync = require('./limitAsync.js');
async function forEachAsync(array, callback, options) {
if (options?.concurrency != null) {
callback = limitAsync.limitAsync(callback, options.concurrency);
}
await Promise.all(array.map(callback));
}
exports.forEachAsync = forEachAsync;