|
Last change
on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago |
|
Added visualizations
|
-
Property mode
set to
100644
|
|
File size:
396 bytes
|
| Line | |
|---|
| 1 | 'use strict';
|
|---|
| 2 |
|
|---|
| 3 | Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|---|
| 4 |
|
|---|
| 5 | const limitAsync = require('./limitAsync.js');
|
|---|
| 6 |
|
|---|
| 7 | async function forEachAsync(array, callback, options) {
|
|---|
| 8 | if (options?.concurrency != null) {
|
|---|
| 9 | callback = limitAsync.limitAsync(callback, options.concurrency);
|
|---|
| 10 | }
|
|---|
| 11 | await Promise.all(array.map(callback));
|
|---|
| 12 | }
|
|---|
| 13 |
|
|---|
| 14 | exports.forEachAsync = forEachAsync;
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.