variable / @typed/router/AST

literal

Constructs an exact literal Path AST node.

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

Import

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

Signatures

export declare const literal: (value: string) => PathAst.Literal;

Why

Runtime route builders need the same explicit literal representation used by formatting and matching.

Ownership and lifetime

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

Source