type-alias / @typed/router/Path

PathParser

The type-level parser for one route path atom after optional slashes.

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

Import

import type { PathParser } from "@typed/router/Path";

Signatures

export type PathParser = Parser.Map<Parser.Zip<SkipSlashesParser, PathAtomParser>, Second>;

Why

Compile-time path parsing reuses the same atom grammar as complete routes.

Ownership and lifetime

TypeScript computes PathParser from the route literal or AST tuple supplied to it; the alias is erased and retains no runtime data.

Source