flow-typed: Express's `Middleware` type is not correct
declare type Middleware =
((req: Request, res: Response, next: NextFunction) => mixed)|
((error: ?Error, req : Request, res: Response, next: NextFunction) => mixed);
I don’t know how flow handle union type of function. But according to the doc and variance rule, Middleware should be an intersection type, not union type.
About this issue
- Original URL
- State: open
- Created 8 years ago
- Reactions: 1
- Comments: 16 (7 by maintainers)
@vkurchatkin Is there no way for flow to determine the types based on arity?