MCPcopy
hub / github.com/caolan/async / doWhilst

Function doWhilst

lib/doWhilst.js:29–38  ·  view source on GitHub ↗
(iteratee, test, callback)

Source from the content-addressed store, hash-verified

27 * `iteratee`'s callback. Invoked with (err, [results]);
28 */
29export default function doWhilst(iteratee, test, callback) {
30 callback = onlyOnce(callback || noop);
31 var _iteratee = wrapAsync(iteratee);
32 var next = rest(function(err, args) {
33 if (err) return callback(err);
34 if (test.apply(this, args)) return _iteratee(next);
35 callback.apply(null, [null].concat(args));
36 });
37 _iteratee(next);
38}

Callers 1

doUntilFunction · 0.85

Calls 3

onlyOnceFunction · 0.85
wrapAsyncFunction · 0.85
restFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…