diff options
-rw-r--r-- | lib/async.js | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/lib/async.js b/lib/async.js index 312000f..f176085 100644 --- a/lib/async.js +++ b/lib/async.js @@ -720,21 +720,8 @@ _parallel(_eachOfLimit(limit), tasks, callback); }; - async.series = function (tasks, callback) { - callback = callback || noop; - var results = _isArrayLike(tasks) ? [] : {}; - - async.eachOfSeries(tasks, function (task, key, callback) { - task(_restParam(function (err, args) { - if (args.length <= 1) { - args = args[0]; - } - results[key] = args; - callback(err); - })); - }, function (err) { - callback(err, results); - }); + async.series = function(tasks, callback) { + _parallel(async.eachOfSeries, tasks, callback); }; async.iterator = function (tasks) { |