We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
type Path = '/groups/:groupId/users/:userId'; type RecursivePathParamsRecord<Path extends string> = Path extends `${infer _Prefix}:${infer ParamName}/${infer Suffix}` ? { [Name in ParamName]: string } & PathParamsRecord<Suffix> : Path extends `${infer _Prefix}:${infer ParamName}` ? { [Name in ParamName]: string } : {}; type PathParamsRecord<Path extends string> = Prettify<RecursivePathParamsRecord<Path>>; type PathParams = PathParamsRecord<Path>; // { // groupId: string; // userId: string; // }
The text was updated successfully, but these errors were encountered:
feat: http interceptor path params (#87) (#140)
2608ae3
### Features - [#zimic] Added support to inferred path params from dynamic URLs. ```ts interceptor.get('/users/:id').respond((request) => { console.log(request.pathParams.id) // '1' return { status: 200, body: users[0], }; }) await fetch('http://localhost:3000/users/1'), { method: 'GET' }); ``` Closes #87.
diego-aquino
Successfully merging a pull request may close this issue.
The text was updated successfully, but these errors were encountered: