@@ -78,14 +78,6 @@ export interface RouteTreeNodeMetadata {
78
78
* The `AdditionalMetadata` type parameter allows for extending the node metadata with custom data.
79
79
*/
80
80
interface RouteTreeNode < AdditionalMetadata extends Record < string , unknown > > {
81
- /**
82
- * The segment value associated with this node.
83
- * A segment is a single part of a route path, typically delimited by slashes (`/`).
84
- * For example, in the route `/users/:id/profile`, the segments are `users`, `:id`, and `profile`.
85
- * Segments can also be wildcards (`*`), which match any segment in that position of the route.
86
- */
87
- segment : string ;
88
-
89
81
/**
90
82
* The index indicating the order in which the route was inserted into the tree.
91
83
* This index helps determine the priority of routes during matching, with lower indexes
@@ -116,7 +108,7 @@ export class RouteTree<AdditionalMetadata extends Record<string, unknown> = {}>
116
108
* The root node of the route tree.
117
109
* All routes are stored and accessed relative to this root node.
118
110
*/
119
- private readonly root = this . createEmptyRouteTreeNode ( '<root>' ) ;
111
+ private readonly root = this . createEmptyRouteTreeNode ( ) ;
120
112
121
113
/**
122
114
* A counter that tracks the order of route insertion.
@@ -144,7 +136,7 @@ export class RouteTree<AdditionalMetadata extends Record<string, unknown> = {}>
144
136
let childNode = node . children . get ( normalizedSegment ) ;
145
137
146
138
if ( ! childNode ) {
147
- childNode = this . createEmptyRouteTreeNode ( normalizedSegment ) ;
139
+ childNode = this . createEmptyRouteTreeNode ( ) ;
148
140
node . children . set ( normalizedSegment , childNode ) ;
149
141
}
150
142
@@ -311,15 +303,13 @@ export class RouteTree<AdditionalMetadata extends Record<string, unknown> = {}>
311
303
}
312
304
313
305
/**
314
- * Creates an empty route tree node with the specified segment .
306
+ * Creates an empty route tree node.
315
307
* This helper function is used during the tree construction.
316
308
*
317
- * @param segment - The route segment that this node represents.
318
309
* @returns A new, empty route tree node.
319
310
*/
320
- private createEmptyRouteTreeNode ( segment : string ) : RouteTreeNode < AdditionalMetadata > {
311
+ private createEmptyRouteTreeNode ( ) : RouteTreeNode < AdditionalMetadata > {
321
312
return {
322
- segment,
323
313
insertionIndex : - 1 ,
324
314
children : new Map ( ) ,
325
315
} ;
0 commit comments