/ lib / utils / debug_util.js
debug_util.js
 1  // util to map async method names
 2  
 3  function extend(filename, async) {
 4    if (async._waterfall !== undefined) {
 5      return;
 6    }
 7    async._waterfall = async.waterfall;
 8    async.waterfall = function (_tasks, callback) {
 9      let tasks = _tasks.map(function (t) {
10        let fn = function () {
11          console.log("async " + filename + ": " + t.name);
12          t.apply(t, arguments);
13        };
14        return fn;
15      });
16      async._waterfall(tasks, callback);
17    };
18  }
19  
20  module.exports = extend;