@@ -15,7 +15,8 @@ const matchChildren = (
1515 const {
1616 queryParamsMode = 'default' ,
1717 strictTrailingSlash = false ,
18- strongMatching = true
18+ strongMatching = true ,
19+ caseSensitive = false
1920 } = options
2021 const isRoot = nodes . length === 1 && nodes [ 0 ] . name === ''
2122 // for (child of node.children) {
@@ -32,12 +33,16 @@ const matchChildren = (
3233 }
3334
3435 if ( ! child . children . length ) {
35- match = child . parser . test ( segment , options )
36+ match = child . parser . test ( segment , {
37+ caseSensitive,
38+ strictTrailingSlash
39+ } )
3640 }
3741
3842 if ( ! match ) {
3943 match = child . parser . partialTest ( segment , {
40- delimited : strongMatching
44+ delimited : strongMatching ,
45+ caseSensitive
4146 } )
4247 }
4348
@@ -46,11 +51,15 @@ const matchChildren = (
4651 let consumedPath = child . parser . build ( match , {
4752 ignoreSearch : true
4853 } )
54+
4955 if ( ! strictTrailingSlash && ! child . children . length ) {
5056 consumedPath = consumedPath . replace ( / \/ $ / , '' )
5157 }
5258
53- remainingPath = segment . replace ( consumedPath , '' )
59+ remainingPath = segment . replace (
60+ new RegExp ( '^' + consumedPath , 'i' ) ,
61+ ''
62+ )
5463
5564 if ( ! strictTrailingSlash && ! child . children . length ) {
5665 remainingPath = remainingPath . replace ( / ^ \/ \? / , '?' )
0 commit comments