MCPcopy Create free account
hub / github.com/PrairieLearn/PrairieLearn / wrapIterator

Function wrapIterator

public/javascripts/async.js:693–709  ·  view source on GitHub ↗
(iterator)

Source from the content-addressed store, hash-verified

691 return callback();
692 }
693 function wrapIterator(iterator) {
694 return _restParam(function (err, args) {
695 if (err) {
696 callback.apply(null, [err].concat(args));
697 }
698 else {
699 var next = iterator.next();
700 if (next) {
701 args.push(wrapIterator(next));
702 }
703 else {
704 args.push(callback);
705 }
706 ensureAsync(iterator).apply(null, args);
707 }
708 });
709 }
710 wrapIterator(async.iterator(tasks))();
711 };
712

Callers 1

async.jsFile · 0.85

Calls 2

_restParamFunction · 0.85
ensureAsyncFunction · 0.85

Tested by

no test coverage detected