summaryrefslogtreecommitdiff
path: root/lib/eachSeries.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/eachSeries.js')
-rw-r--r--lib/eachSeries.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/eachSeries.js b/lib/eachSeries.js
index ae6f6c7..b4a86ba 100644
--- a/lib/eachSeries.js
+++ b/lib/eachSeries.js
@@ -1,5 +1,5 @@
import eachLimit from './eachLimit';
-import doLimit from './internal/doLimit';
+import awaitify from './internal/awaitify'
/**
* The same as [`each`]{@link module:Collections.each} but runs only a single async operation at a time.
@@ -19,5 +19,9 @@ import doLimit from './internal/doLimit';
* Invoked with (item, callback).
* @param {Function} [callback] - A callback which is called when all
* `iteratee` functions have finished, or an error occurs. Invoked with (err).
+ * @returns {Promise} a promise, if a callback is omitted
*/
-export default doLimit(eachLimit, 1);
+function eachSeries(coll, iteratee, callback) {
+ return eachLimit(coll, 1, iteratee, callback)
+}
+export default awaitify(eachSeries, 3);