Skip to main content
zerotal

Documentation


Documentation / zerotal / client / PathParams

Type Alias: PathParams<Path>

PathParams<Path> = Path extends `${string}{${infer Param}}${infer Tail}` ? Param | PathParams<Tail> : never

Defined in: packages/client/src/types.ts:10

Extract the names of all {param} placeholders from a URL path string.

Type Parameters

Path

Path extends string

Example

PathParams<'/api/users/{id}/posts/{postId}'>
// → 'id' | 'postId'