File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
packages/router/src/experimental/route-resolver/matchers Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,7 @@ export class MatcherPatternPathStatic
8888 * ```ts
8989 * const matcher = new MatcherPatternPathStar('/team')
9090 * matcher.match('/team/123') // { pathMatch: '/123' }
91+ * matcher.match('/team/123/more') // { pathMatch: '/123/more' }
9192 * matcher.match('/team-123') // { pathMatch: '-123' }
9293 * matcher.match('/team') // { pathMatch: '' }
9394 * matcher.build({ pathMatch: '/123' }) // '/team/123'
@@ -102,12 +103,11 @@ export class MatcherPatternPathStar
102103 }
103104
104105 match ( path : string ) : { pathMatch : string } {
105- const pathMatchIndex = path . toLowerCase ( ) . indexOf ( this . path )
106- if ( pathMatchIndex < 0 ) {
106+ if ( ! path . toLowerCase ( ) . startsWith ( this . path ) ) {
107107 throw miss ( )
108108 }
109109 return {
110- pathMatch : path . slice ( pathMatchIndex + this . path . length ) ,
110+ pathMatch : path . slice ( this . path . length ) ,
111111 }
112112 }
113113
You can’t perform that action at this time.
0 commit comments