MCPcopy
hub / github.com/socketio/socket.io / apply

Function apply

packages/engine.io/lib/server.ts:382–395  ·  view source on GitHub ↗
(i)

Source from the content-addressed store, hash-verified

380 }
381
382 const apply = (i) => {
383 debug("applying middleware n°%d", i + 1);
384 this.middlewares[i](req, res, (err?: any) => {
385 if (err) {
386 return callback(err);
387 }
388
389 if (i + 1 < this.middlewares.length) {
390 apply(i + 1);
391 } else {
392 callback();
393 }
394 });
395 };
396
397 apply(0);
398 }

Callers 1

_applyMiddlewaresFunction · 0.85

Calls 2

debugFunction · 0.85
callbackFunction · 0.50

Tested by

no test coverage detected