1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.default = promiseForObject;
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 | function promiseForObject(object) {
|
16 | var keys = Object.keys(object);
|
17 | var valuesAndPromises = keys.map(function (name) {
|
18 | return object[name];
|
19 | });
|
20 | return Promise.all(valuesAndPromises).then(function (values) {
|
21 | return values.reduce(function (resolvedObject, value, i) {
|
22 | resolvedObject[keys[i]] = value;
|
23 | return resolvedObject;
|
24 | }, Object.create(null));
|
25 | });
|
26 | }
|