traxxx-web/utils/promise-props.js

6 lines
201 B
JavaScript
Raw Normal View History

2024-03-21 04:16:19 +00:00
export default async function promiseProps(obj) {
const resolved = await Promise.all(Object.entries(obj).map(async ([key, promise]) => [key, await promise]));
return Object.fromEntries(resolved);
}