variable / @typed/router/AST

route

Constructs a route-case Match AST node with its guard and handler.

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

Import

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

Signatures

export declare const route: (route: RouteAst, handler: MatchHandler<any, any, any, any>, guard?: Guard<any, any, any, any>) => MatchAst.Route;

Why

Candidate order, decoding, guard selection, and output remain one inspectable registration unit.

Ownership and lifetime

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

Source