Skip to content

Commit

Permalink
Let missing routes match catch-all routes (#1948)
Browse files Browse the repository at this point in the history
  • Loading branch information
elia committed Apr 11, 2024
1 parent a209019 commit f0c58e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/cli/src/lib/missing-routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export function findMissingRoutes(
requiredRoute
.replaceAll('.', '\\.') // Escape dots
.replace(/\//g, `\\/(${optionalSegment}\\/)?`) // Has optional segments in the middle
.replace(/:[^/)?]+/g, ':[^\\/]+') + // Replace params with regex
.replace(/:[^/)?]+/g, '(:[^\\/]+|\\*)') + // Replace params with regex
`(\\/${optionalSegment})?$`; // Ends with an optional segment

if (new RegExp(reString).test(currentRoute.path)) {
Expand Down

0 comments on commit f0c58e0

Please sign in to comment.