diff options
Diffstat (limited to 'lib/internal/parallel.js')
-rw-r--r-- | lib/internal/parallel.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/internal/parallel.js b/lib/internal/parallel.js index bbfdb42..6246d8f 100644 --- a/lib/internal/parallel.js +++ b/lib/internal/parallel.js @@ -1,6 +1,5 @@ import isArrayLike from './isArrayLike'; import noop from './noop'; -import slice from './slice'; import wrapAsync from './wrapAsync'; export default function _parallel(eachfn, tasks, callback) { @@ -8,9 +7,9 @@ export default function _parallel(eachfn, tasks, callback) { var results = isArrayLike(tasks) ? [] : {}; eachfn(tasks, function (task, key, callback) { - wrapAsync(task)(function (err, result) { - if (arguments.length > 2) { - result = slice(arguments, 1); + wrapAsync(task)(function (err, ...result) { + if (result.length < 2) { + result = result[0]; } results[key] = result; callback(err); |