embark-area-51/lib/utils/async_extend.js

16 lines
287 B
JavaScript
Raw Normal View History

2017-03-29 17:50:05 +00:00
let async = require('async');
2017-03-11 15:52:02 +00:00
function asyncEachObject(object, iterator, callback) {
async.each(
Object.keys(object || {}),
2017-03-30 11:12:39 +00:00
function (key, next) {
2017-03-11 15:52:02 +00:00
iterator(key, object[key], next);
},
callback
);
}
2017-03-30 11:12:39 +00:00
2017-03-11 15:52:02 +00:00
async.eachObject = asyncEachObject;
module.exports = async;