Skip to content
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

fix(matchAll): sort routes with same type #45

Merged
merged 1 commit into from
Mar 27, 2023
Merged

fix(matchAll): sort routes with same type #45

merged 1 commit into from
Mar 27, 2023

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Mar 27, 2023

resolves #44

The return value of matchAll normally should return from less specific to most specific matches (wildcard > params > static). However when checking same kind of rules, like between wildcards, we was not sorting them. Comparing by length as simplest possible workaround we might improve it later if there was more edge cases when comparing same type.

@pi0 pi0 changed the title fix(matchAll): sort route with same type fix(matchAll): sort routes with same type Mar 27, 2023
@pi0 pi0 merged commit 2a50309 into main Mar 27, 2023
@pi0 pi0 deleted the fix/sort-match-all branch March 27, 2023 15:40
pi0 added a commit to nuxt/nuxt.com that referenced this pull request Mar 27, 2023
danielroe pushed a commit to nuxt/nuxt.com that referenced this pull request Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Route-matcher is not matching the most specific rule
1 participant