File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 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[] => {
487487 * - `/one/three/:five` (because `/one/three/:four` has priority)
488488 * - `/one/:two/three/:five` (because `/one/:two/three/:four` has priority)
489489 */
490- let explodeOptionalSegments = function * ( path : string ) {
490+ let explodeOptionalSegments = ( path : string ) => {
491+ let result : string [ ] = [ ] ;
491492 // Compute hash for dynamic path segments
492493 // /one/:two/three/:four -> /one/:/three/:
493494 let dynamicHash = ( subpath : string ) =>
@@ -510,12 +511,13 @@ let explodeOptionalSegments = function* (path: string) {
510511
511512 // for absolute paths, ensure `/` instead of empty segment
512513 if ( path . startsWith ( "/" ) && exploded === "" ) {
513- yield "/" ;
514+ result . push ( "/" ) ;
514515 continue ;
515516 }
516517
517- yield exploded ;
518+ result . push ( exploded ) ;
518519 }
520+ return result ;
519521} ;
520522
521523function rankRouteBranches ( branches : RouteBranch [ ] ) : void {
You can’t perform that action at this time.
0 commit comments