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

Function whilst

lib/whilst.js:41–51  ·  view source on GitHub ↗
(test, iteratee, callback)

Source from the content-addressed store, hash-verified

39 * );
40 */
41export default function whilst(test, iteratee, callback) {
42 callback = onlyOnce(callback || noop);
43 var _iteratee = wrapAsync(iteratee);
44 if (!test()) return callback(null);
45 var next = rest(function(err, args) {
46 if (err) return callback(err);
47 if (test()) return _iteratee(next);
48 callback.apply(null, [null].concat(args));
49 });
50 _iteratee(next);
51}

Callers 1

untilFunction · 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…