File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed
packages/start/src/router Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -33,17 +33,17 @@ function defineRoutes(fileRoutes: Route[]) {
3333 } ) ;
3434
3535 if ( ! parentRoute ) {
36- routes . push ( {
37- ... route ,
38- id ,
39- path : id
40- // strip out escape group for escaping nested routes - e.g. foo( bar) -> foo
41- . replace ( / \/ \( [ ^ ) / ] + \) / g, "" )
42- . replace ( / \( [ ^ ) / ] + \) / g , "" )
43- // replace . with / for flat routes - e.g. foo.bar -> foo/bar
44- // ensures that ... of splat routes is not replaced
45- . replace ( / (?< ! \. ) \. (? ! \. ) / g , "/" )
46- } ) ;
36+ const path = id
37+ // strip out escape group for escaping nested routes - e.g. foo(bar) -> foo
38+ . replace ( / \/ \( [ ^ ) / ] + \) / g , "" )
39+ . replace ( / \( [ ^ ) / ] + \) / g , "" )
40+ // replace . with / for flat routes - e.g. foo. bar -> foo/bar
41+ . replace ( / \. / g, "/ " )
42+ // converts any splat route ... that got replaced back from ///
43+ // this could be avoided with a lookbehind regex but safar has only supported them since mid 2023
44+ . replace ( "///" , " ..." ) ;
45+
46+ routes . push ( { ... route , id , path } ) ;
4747 return routes ;
4848 }
4949 processRoute (
You can’t perform that action at this time.
0 commit comments