UNPKG

jest-allure2-reporter

Version:
13 lines (11 loc) 417 B
import type { PromisedProperties } from 'jest-allure2-reporter'; export async function resolvePromisedProperties<T>( maybePromised: PromisedProperties<T>, ): Promise<T> { const promised = await maybePromised; const entries = Object.entries(promised); const resolvedEntries = await Promise.all( entries.map(async ([key, value]) => [key, await value]), ); return Object.fromEntries(resolvedEntries); }