UNPKG

combine-promises

Version:

[![NPM](https://img.shields.io/npm/dm/combine-promises.svg)](https://www.npmjs.com/package/combine-promises) [![CI](https://github.com/slorber/combine-promises/actions/workflows/main.yml/badge.svg)](https://github.com/slorber/combine-promises/actions/work

8 lines (7 loc) 353 B
declare type UnwrapPromise<P extends unknown> = P extends PromiseLike<infer V> ? V : P; declare type Input = Record<string | number | symbol, unknown>; declare type Result<Obj extends Input> = { [P in keyof Obj]: UnwrapPromise<Obj[P]>; }; export default function combinePromises<Obj extends Input>(obj: Obj): Promise<Result<Obj>>; export {};