export type Await = T extends Promise ? U : T export type AwaitProps = {[P in keyof T]: Await} export type PromisedProps = {[P in keyof T]: T[P] | Promise} export async function concurrent(obj: T): Promise> { const keys = Object.keys(obj) const awaitables = Object.values(obj) const values = await Promise.all(awaitables) const result = {} keys.forEach((key, i) => result[key] = values[i]) return >result }