MCPcopy Index your code
hub / github.com/ionic-team/ionic-framework / flattenRouterTree

Function flattenRouterTree

core/src/components/router/utils/parser.ts:66–72  ·  view source on GitHub ↗
(nodes: RouteTree)

Source from the content-addressed store, hash-verified

64 * Each chain represents a path from the root node to a terminal node.
65 */
66export const flattenRouterTree = (nodes: RouteTree): RouteChain[] => {
67 const chains: RouteChain[] = [];
68 for (const node of nodes) {
69 flattenNode([], chains, node);
70 }
71 return chains;
72};
73
74/** Flattens a route node recursively and push each branch to the chains list. */
75const flattenNode = (chain: RouteChain, chains: RouteChain[], node: RouteNode) => {

Callers 2

parser.spec.tsxFile · 0.90
readRoutesFunction · 0.85

Calls 1

flattenNodeFunction · 0.85

Tested by

no test coverage detected