mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2025-07-27 17:00:06 +02:00

* Convert event-tracking to TypeScript * Convert local-storage to TypeScript * Convert mapSeries to TypeScript * Convert SessionStorage to TypeScript * Convert account-upgrade to TypeScript * Convert isValidTeXFile to TypeScript * Convert date functions to TypeScript * Convert EventEmitter to TypeScript * Convert isNetworkError to TypeScript * Convert webpack-public-path to TypeScript * Convert displayNameForUser to TypeScript GitOrigin-RevId: 79c5a2d1101fcd520f3116f0f4af29d974189d94
13 lines
302 B
TypeScript
13 lines
302 B
TypeScript
/**
|
|
* run `fn` in series for all values, and resolve with an array of the results
|
|
*/
|
|
export const mapSeries = async <T = any, V = any>(
|
|
values: T[],
|
|
fn: (item: T) => Promise<V>
|
|
) => {
|
|
const output: V[] = []
|
|
for (const value of values) {
|
|
output.push(await fn(value))
|
|
}
|
|
return output
|
|
}
|