UNPKG

promisary

Version:

A growing collection of utilities to make working with Promises easier and cleaner.

10 lines (9 loc) 293 B
export async function hash(obj) { if (obj == null) return {}; const entries = Object.entries(obj); const resolvedEntries = await Promise.all(entries.map(async ([key, value]) => { return [key, await value]; })); return Object.fromEntries(resolvedEntries); }