summaryrefslogtreecommitdiff
path: root/lib/until.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/until.js')
-rw-r--r--lib/until.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/until.js b/lib/until.js
index 37d8922..0c407a3 100644
--- a/lib/until.js
+++ b/lib/until.js
@@ -22,6 +22,7 @@ import wrapAsync from './internal/wrapAsync';
* function has passed and repeated execution of `iteratee` has stopped. `callback`
* will be passed an error and any arguments passed to the final `iteratee`'s
* callback. Invoked with (err, [results]);
+ * @returns {Promise} a promise, if a callback is not passed
*
* @example
* const results = []
@@ -39,5 +40,5 @@ import wrapAsync from './internal/wrapAsync';
*/
export default function until(test, iteratee, callback) {
const _test = wrapAsync(test)
- whilst((cb) => _test((err, truth) => cb (err, !truth)), iteratee, callback);
+ return whilst((cb) => _test((err, truth) => cb (err, !truth)), iteratee, callback);
}