express-serve-static-core change makes problems with RegEx in route parameters #53848
Unanswered
Nightloewe
asked this question in
Issues with a @types package
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This commit changed the value of
req.params
fromParamsDictionary
toRouteParameters<T>
which now causes errors when trying to use an url like/:id([0-9]+)
to validate the route parameter. The error is:Property 'id' does not exist on type 'RouteParameters<"/:id([0-9]+)">'. ts(2339)
Normally you should be able to use regular expressions for route parameters and then access them by
req.params.id
, but TypeScript shows this as an error.Beta Was this translation helpful? Give feedback.
All reactions