|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
271 bytes
|
| Line | |
|---|
| 1 | import { limitAsync } from './limitAsync.mjs';
|
|---|
| 2 |
|
|---|
| 3 | function mapAsync(array, callback, options) {
|
|---|
| 4 | if (options?.concurrency != null) {
|
|---|
| 5 | callback = limitAsync(callback, options.concurrency);
|
|---|
| 6 | }
|
|---|
| 7 | return Promise.all(array.map(callback));
|
|---|
| 8 | }
|
|---|
| 9 |
|
|---|
| 10 | export { mapAsync };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.