mirror of
https://github.com/sasjs/lint.git
synced 2025-12-11 01:44:36 +00:00
12 lines
304 B
TypeScript
12 lines
304 B
TypeScript
/**
|
|
* Executes an async callback for each item in the given array.
|
|
*/
|
|
export async function asyncForEach(
|
|
array: any[],
|
|
callback: (item: any, index: number, originalArray: any[]) => any
|
|
) {
|
|
for (let index = 0; index < array.length; index++) {
|
|
await callback(array[index], index, array)
|
|
}
|
|
}
|