-
-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
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
feat(path-to-regexp): path-to-regexp 8.1.0 update #976
Conversation
frankkeefer
commented
Sep 12, 2024
- Change path-to-regexp 6.2.2 to 8.1.0
- Update code to handled changes in path-to-regexp v6.x.x -> v8.x.x
const strict = !!req.app.enabled('strict routing'); | ||
const sensitive = !!req.app.enabled('case sensitive routing'); | ||
const pathOpts = { | ||
sensitive, | ||
strict, | ||
}; | ||
const regexp = pathToRegexp(expressRoute, keys, pathOpts); | ||
const regexpObj = pathToRegexp(expressRoute, pathOpts); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can remove let keys = []; and keys = regexpObj.keys;
and directly use
const { regexpObj, keys } = pathToRegexp(expressRoute, pathOpts);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in requested changes.
- removed let keys =[] and related uses
- removed const regexp = regepObj.regexp; and related uses
All current unit tests still pass locally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can remove let keys = []; and keys = regexpObj.keys;
and directly use
const { regexpObj, keys } = pathToRegexp(expressRoute, pathOpts);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you. this is great
Please create a release 🙏🏻 |