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

Function objectifyPromiseResults

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

Source from the content-addressed store, hash-verified

59}
60
61export async function objectifyPromiseResults<
62 K extends string[],
63 P extends PromiseLike<any[]>,
64>(
65 keys: K,
66 promise: P,
67): Promise<{
68 [key in K[number]]: P extends PromiseLike<infer T extends any[]>
69 ? T[number]
70 : never;
71}> {
72 const results = await promise;
73
74 return objFromEntries(keys.map((key, index) => [key, results[index]])) as any;
75}
76
77export async function allSettledResults<T extends readonly [...any]>(
78 promises: [...T],

Callers 1

_flushHGetBufferMethod · 0.90

Calls 1

objFromEntriesFunction · 0.90

Tested by

no test coverage detected