2020-11-27 19:27:44 +01:00
|
|
|
async function asyncForEach(
|
|
|
|
array: Array<any>,
|
|
|
|
callback: (arg0: any, arg1: number, arg2: Array<any>) => any
|
|
|
|
): Promise<void> {
|
2020-03-05 19:32:34 +01:00
|
|
|
for (let index = 0; index < array.length; index += 1) {
|
2020-11-27 19:27:44 +01:00
|
|
|
// eslint-disable-next-line no-await-in-loop
|
2020-03-05 19:32:34 +01:00
|
|
|
await callback(array[index], index, array);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export { asyncForEach };
|