(i)
| 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 | } |
no test coverage detected