-
Notifications
You must be signed in to change notification settings - Fork 21
POC for custom route patterns #837
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
|
|
||
| for (const pattern of customPatterns) { | ||
| if (pattern.test(segment)) { | ||
| return `:custom`; |
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.
shouldn't we return the actual pattern name set by the app? eg: :tenant
| return; | ||
| } | ||
|
|
||
| if (registeredPatternsSet.has(pattern)) { |
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.
Check before compiling?
| const NUMBER_ARRAY = /^\d+(?:,\d+)*$/; | ||
|
|
||
| export function buildRouteFromURL(url: string) { | ||
| export function buildRouteFromURL(url: string, custom: RegExp[]) { |
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.
Make custom parameter optional and call getRegisteredRouteParams() by default, so we can still easily test but don't have to modify so many files? Only an idea, not required.
No description provided.