That was... non-trivial.
export async function promiseAll<T extends Record<string, Promise<any>>>(promises: T): Promise<{ [K in keyof T]: Awaited<T[K]> }> { const keys = Object.keys(promises) as Array<keyof T>; const result = await Promise.all(keys.map(key => promises[key])); return Object.fromEntries(result.map((value, i) => [keys[i], value])) as { [K in keyof T]: Awaited<T[K]> };
reply
Without internet or AI I wouldn't attempt writing anything like that.
That was... non-trivial.