@naturalcycles/js-lib
Version:
Standard library for universal (browser + Node.js) javascript
20 lines (19 loc) • 588 B
TypeScript
/**
* Promise.all for Object instead of Array.
*
* Inspired by Bluebird Promise.props() and https://github.com/sindresorhus/p-props
*
* Improvements:
*
* - Exported as { pProps }, so IDE auto-completion works
* - Simpler: no support for Map, Mapper, Options
* - Included Typescript typings (no need for @types/p-props)
*
* Concurrency implementation via pMap was removed in favor of preserving async
* stack traces (more important!).
*/
export declare function pProps<T>(input: {
[K in keyof T]: T[K] | Promise<T[K]>;
}): Promise<{
[K in keyof T]: Awaited<T[K]>;
}>;