File tree 1 file changed +5
-3
lines changed
1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -487,7 +487,8 @@ let _explodeOptionalSegments = (path: string): string[] => {
487
487
* - `/one/three/:five` (because `/one/three/:four` has priority)
488
488
* - `/one/:two/three/:five` (because `/one/:two/three/:four` has priority)
489
489
*/
490
- let explodeOptionalSegments = function * ( path : string ) {
490
+ let explodeOptionalSegments = ( path : string ) => {
491
+ let result : string [ ] = [ ] ;
491
492
// Compute hash for dynamic path segments
492
493
// /one/:two/three/:four -> /one/:/three/:
493
494
let dynamicHash = ( subpath : string ) =>
@@ -510,12 +511,13 @@ let explodeOptionalSegments = function* (path: string) {
510
511
511
512
// for absolute paths, ensure `/` instead of empty segment
512
513
if ( path . startsWith ( "/" ) && exploded === "" ) {
513
- yield "/" ;
514
+ result . push ( "/" ) ;
514
515
continue ;
515
516
}
516
517
517
- yield exploded ;
518
+ result . push ( exploded ) ;
518
519
}
520
+ return result ;
519
521
} ;
520
522
521
523
function rankRouteBranches ( branches : RouteBranch [ ] ) : void {
You can’t perform that action at this time.
0 commit comments