variable / @typed/router/AST

parameter

Constructs a named parameter Path AST node with optional and regex constraints.

Package version
1.0.0-beta.7
Category
Path syntax
Since
1.0.0

Import

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

Signatures

export declare const parameter: (name: string, optional?: boolean, regex?: string) => PathAst.Parameter;

Why

Runtime builders retain constraints for matcher registration and schema derivation.

Ownership and lifetime

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

Source