We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
use()
for-in
1 parent ac7e2fa commit 259e6b6Copy full SHA for 259e6b6
1 file changed
index.js
@@ -467,12 +467,12 @@ class API {
467
let middleware = [];
468
469
// Add func args as middleware
470
- for (let arg in args) {
471
- if (typeof args[arg] === 'function') {
472
- if (args[arg].length === 3) {
473
- middleware.push(args[arg]);
474
- } else if (args[arg].length === 4) {
475
- this._errors.push(args[arg]);
+ for (let arg of args) {
+ if (typeof arg === 'function') {
+ if (arg.length === 3) {
+ middleware.push(arg);
+ } else if (arg.length === 4) {
+ this._errors.push(arg);
476
} else {
477
throw new ConfigurationError(
478
'Middleware must have 3 or 4 parameters'
0 commit comments