Improve some utils modules

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2022-08-29 16:52:18 +02:00
parent d43e7f2c34
commit b36ce27bbe
2 changed files with 28 additions and 7 deletions

View File

@@ -1,11 +1,9 @@
async function asyncForEach(
array: Array<any>,
// eslint-disable-next-line no-unused-vars
callback: (arg0: any, arg1: number, arg2: Array<any>) => void
): Promise<void> {
for (let index = 0; index < array.length; index += 1) {
// eslint-disable-next-line no-await-in-loop
await callback(array[index], index, array);
callback(array[index], index, array);
}
}