{ path: '/users/:id', name: 'user', component: User },
{ path: '/documents/:id', name: 'docs', component: User },
{ path: '/n/:n', name: 'increment', component },
- { path: '/multiple/:a/:b', name: 'user', component },
+ { path: '/multiple/:a/:b', name: 'multiple', component },
{
path: '/with-guard/:n',
name: 'guarded',
const from = this.$route as RouteLocationNormalized
// @ts-ignore can't get `this`
const to = this.to as RouteLocation
+
// @ts-ignore can't get `this`
const history = router.history
let url: HistoryLocationNormalized
}
}
- function scoreForSegment(group: pathToRegexp.Token): number {
+ const scoreForSegment = function scoreForSegment(
+ group: pathToRegexp.Token
+ ): number {
let score = PathScore.Segment
if (typeof group === 'string') {
score += group === '/' ? PathScore.Root : PathScore.Static
return score
}
- function scoreForSubSegment(group: pathToRegexp.Token): number {
+ const scoreForSubSegment = function scoreForSubSegment(
+ group: pathToRegexp.Token
+ ): number {
let score = 0
if (typeof group === 'string') {
// in a sub segment, it doesn't matter if it's root or not