11 lines
239 B
JavaScript
11 lines
239 B
JavaScript
var _ = require("lodash");
|
|
var Q = require("q");
|
|
|
|
function mapObjectPromises(input, func) {
|
|
return Q.all(_.map(input, func)).then(function(data) {
|
|
return _.zipObject(_.keys(input), data);
|
|
});
|
|
}
|
|
|
|
module.exports = mapObjectPromises;
|