variable / @typed/router/AST

prefixed

Wraps Match AST nodes with a structural Route prefix.

Package version
1.0.0-beta.13
Category
Matcher composition syntax
Since
1.0.0

Import

import { prefixed } from "@typed/router/AST";

Signatures

export declare const prefixed: (matches: ReadonlyArray<MatchAst>, prefix: RouteAst) => MatchAst.Prefixed;

Why

Nested tables can be mounted without rewriting child paths.

Ownership and lifetime

prefixed returns a fresh plain AST node immediately and retains any supplied child nodes or arrays by reference; it acquires no external resource.

Source