You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description: router.use method doesn't work with RegExp
Actual behavior
I'm trying to set a middleware for just some routes in a path by using RegExp. It appears the error
([^/]*)`: `middleware` must be a function, not `object
I think that there is a bug with selecting the RegExp type because it does not match against the defined method in the Router class and it uses the first one. Should be using the second definition:
Describe the bug
Node.js version: 18.17.1
@koa/router: 12.0.0
Typescript target: ES2020
OS version: Windows 10 Enterprise
Description: router.use method doesn't work with RegExp
Actual behavior
I'm trying to set a middleware for just some routes in a path by using RegExp. It appears the error
I think that there is a bug with selecting the RegExp type because it does not match against the defined method in the Router class and it uses the first one. Should be using the second definition:
Expected behavior
Should work the same as using:
Code to reproduce
Checklist
The text was updated successfully, but these errors were encountered: