Skip to content

Function: buildRouteTree()

Documentation / @xmachines/play-router / buildRouteTree

function buildRouteTree(routes): RouteTree;

Defined in: build-tree.ts:13

Build hierarchical route tree from flat route list

Constructs nested tree respecting parent-child state relationships. Absolute routes become top-level, relative routes nest under parents. Creates bidirectional maps for state ID ↔ path lookup.

Parameters

ParameterTypeDescription
routesRouteInfo[]Flat list of RouteInfo from extraction

Returns

RouteTree

RouteTree with root, byStateId map, and byPath map