We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In this example the middleware is "wrongly" classed as a Handler and not a MiddlewareFunc
(method) BunServer.use(middleware: Handler): void app.use((req: BunRequest, res: BunResponse, next: ((err?: Error | undefined) => {}) | undefined) => { console.log("middlewares called"); next!(); // Results in next() possible undefined })
What it should classify it as src/server/request.ts
src/server/request.ts
11 export type MiddlewareFunc = ( 12 req: Request, 13 res: BunResponse, 14 next: (err?: Error) => {} 15 ) => void;
The errorhandler in src/server/server.ts also switches the err and next function around based on the type definitions from src/server/request.ts
src/server/server.ts
4 export type Handler = ( 5 req: BunRequest, 6 res: BunResponse, 7 next?: (err?: Error) => {}, 8 err?: Error 9 ) => void | Promise<any>;
229 that.errorHandlers.forEach((handler) => { 230 // * no request object pass to error handler 231 handler.apply(that, [null, res, err, next]); 232 });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
In this example the middleware is "wrongly" classed as a Handler and not a MiddlewareFunc
What it should classify it as
src/server/request.ts
The errorhandler in
src/server/server.ts
also switches the err and next function around based on the type definitions fromsrc/server/request.ts
src/server/server.ts
The text was updated successfully, but these errors were encountered: