2017-03-01 04:29:16 +00:00
|
|
|
// util to map async method names
|
|
|
|
|
|
|
|
function extend(filename, async) {
|
|
|
|
if (async._waterfall !== undefined) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
async._waterfall = async.waterfall;
|
2017-03-30 11:12:39 +00:00
|
|
|
async.waterfall = function (_tasks, callback) {
|
|
|
|
let tasks = _tasks.map(function (t) {
|
|
|
|
let fn = function () {
|
2017-03-01 04:29:16 +00:00
|
|
|
console.log("async " + filename + ": " + t.name);
|
|
|
|
t.apply(t, arguments);
|
|
|
|
};
|
|
|
|
return fn;
|
|
|
|
});
|
|
|
|
async._waterfall(tasks, callback);
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = extend;
|