Skip to content

Commit 87320b7

Browse files
committed
chore: docs and logs
1 parent 880e6d7 commit 87320b7

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

packages/router/src/matcher/index.ts

+9-2
Original file line numberDiff line numberDiff line change
@@ -545,10 +545,10 @@ function findInsertionIndex(
545545
if (insertionAncestor) {
546546
upper = matchers.lastIndexOf(insertionAncestor, upper - 1)
547547

548-
if (__DEV__ && upper === -1) {
548+
if (__DEV__ && upper < 0) {
549549
// This should never happen
550550
warn(
551-
`Finding ancestor route ${insertionAncestor.record.path} failed for ${matcher.record.path}`
551+
`Finding ancestor route "${insertionAncestor.record.path}" failed for "${matcher.record.path}"`
552552
)
553553
}
554554
}
@@ -571,6 +571,13 @@ function getInsertionAncestor(matcher: RouteRecordMatcher) {
571571
return
572572
}
573573

574+
/**
575+
* Checks if a matcher can be reachable. This means if it's possible to reach it as a route. For example, routes without
576+
* a component, or name, or redirect, are just used to group other routes.
577+
* @param matcher
578+
* @param matcher.record record of the matcher
579+
* @returns
580+
*/
574581
function isMatchable({ record }: RouteRecordMatcher): boolean {
575582
return !!(
576583
record.name ||

0 commit comments

Comments
 (0)