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

Function _applyEach

public/javascripts/async.js:1164–1181  ·  view source on GitHub ↗
(eachfn)

Source from the content-addressed store, hash-verified

1162
1163
1164 function _applyEach(eachfn) {
1165 return _restParam(function(fns, args) {
1166 var go = _restParam(function(args) {
1167 var that = this;
1168 var callback = args.pop();
1169 return eachfn(fns, function (fn, _, cb) {
1170 fn.apply(that, args.concat([cb]));
1171 },
1172 callback);
1173 });
1174 if (args.length) {
1175 return go.apply(this, args);
1176 }
1177 else {
1178 return go;
1179 }
1180 });
1181 }
1182
1183 async.applyEach = _applyEach(async.eachOf);
1184 async.applyEachSeries = _applyEach(async.eachOfSeries);

Callers 1

async.jsFile · 0.85

Calls 1

_restParamFunction · 0.85

Tested by

no test coverage detected