function / @typed/router/Path

flattenRouteAst

Flattens joined and transformed Route AST nodes to their path atoms.

Package version
1.0.0-beta.7
Category
Route structure validation
Since
1.0.0

Import

import { flattenRouteAst } from "@typed/router/Path";

Signatures

export declare function flattenRouteAst(ast: RouteAst): ReadonlyArray<PathAst>;

Why

Formatting and input analysis can ignore schema wrappers while preserving route order.

Ownership and lifetime

flattenRouteAst traverses the supplied AST immediately and returns a fresh array; child AST and Schema values in that array remain shared references.

Source