type-alias / @typed/router/Path

Join

Formats a tuple of Path AST nodes as its normalized route string literal type.

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

Import

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

Signatures

export type Join<Parts extends ReadonlyArray<PathAst>> = `/${StringJoin<{
    [K in keyof Parts]: FormatAst<Parts[K]>;
}, "">}`;

Why

Compile-time Route paths use the same slash, parameter, wildcard, and query formatting rules as the runtime join function.

Ownership and lifetime

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

Source