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) • 379 B
JavaScript
;
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const limitAsync = require('./limitAsync.js');
function mapAsync(array, callback, options) {
if (options?.concurrency != null) {
callback = limitAsync.limitAsync(callback, options.concurrency);
}
return Promise.all(array.map(callback));
}
exports.mapAsync = mapAsync;