"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.objPromise = objPromise;
exports.promiseSeries = promiseSeries;
async function objPromise(obj) {
    const _obj = {};
    for (const key in obj) {
        const p = obj[key];
        _obj[key] = await p;
    }
    return _obj;
}
function promiseSeries(providers) {
    const _return = Promise.resolve(null);
    const results = [];
    return providers
        .reduce(function (result, provider, index) {
        return result.then(function () {
            return provider().then(function (value) {
                results[index] = value;
            });
        });
    }, _return)
        .then(function () {
        return results;
    });
}
//# sourceMappingURL=promise.js.map