MCPcopy Create free account
hub / github.com/DeepNotesApp/DeepNotes / namedPromises

Function namedPromises

packages/@stdlib/misc/src/promises.ts:18–30  ·  view source on GitHub ↗
(
  keys: K,
  promises: P,
)

Source from the content-addressed store, hash-verified

16}
17
18export async function namedPromises<
19 K extends string[],
20 P extends PromiseLike<any>[],
21>(
22 keys: K,
23 promises: P,
24): Promise<{
25 [key in K[number]]: P[number] extends PromiseLike<infer T> ? T : never;
26}> {
27 const results = await Promise.all(promises);
28
29 return objFromEntries(keys.map((key, index) => [key, results[index]])) as any;
30}
31
32export async function promiseProp<
33 P extends PromiseLike<any>,

Callers 2

update-flushing.tsFile · 0.90
allAsyncPropsFunction · 0.85

Calls 1

objFromEntriesFunction · 0.90

Tested by

no test coverage detected