export async function asyncMap(array: Array, fn: (item: T) => Promise): Promise> { return Promise.all(array.map(fn)); } export async function asyncMapSeries(array: Array, fn: (item: T) => Promise): Promise> { const results: Array = []; for (const item of array) { results.push(await fn(item)); } return results; }