diff options
Diffstat (limited to 'lib/doUntil.js')
-rw-r--r-- | lib/doUntil.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/doUntil.js b/lib/doUntil.js index d2e5b04..a484df6 100644 --- a/lib/doUntil.js +++ b/lib/doUntil.js @@ -20,10 +20,11 @@ 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 no callback is passed */ export default function doUntil(iteratee, test, callback) { const _test = wrapAsync(test) - doWhilst(iteratee, (...args) => { + return doWhilst(iteratee, (...args) => { const cb = args.pop() _test(...args, (err, truth) => cb (err, !truth)) }, callback); |