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: correctly calculate path when pathMatch is empty string (fix #3106) #3111

Merged
merged 2 commits into from
Jan 29, 2020

Conversation

adi-zz
Copy link
Contributor

@adi-zz adi-zz commented Jan 29, 2020

No description provided.

@@ -20,7 +20,8 @@ export function fillParams (
(regexpCompileCache[path] = Regexp.compile(path))

// Fix #2505 resolving asterisk routes { name: 'not-found', params: { pathMatch: '/not-found' }}
if (params.pathMatch) params[0] = params.pathMatch
// `params.pathMatch === ''` fixes #3106 so that you can work with location descriptor object having params.pathMatch equal to empty string
if (params.pathMatch || params.pathMatch === '') params[0] = params.pathMatch
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's just check if it's a string with a typeof operator

test/unit/specs/create-matcher.spec.js Outdated Show resolved Hide resolved
test/unit/specs/create-matcher.spec.js Outdated Show resolved Hide resolved
@adi-zz adi-zz requested a review from posva January 29, 2020 16:19
Copy link
Member

@posva posva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@posva posva merged commit 38e6ccd into vuejs:dev Jan 29, 2020
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.

2 participants