We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3a9a0f4 + a27e388 commit 64dc7afCopy full SHA for 64dc7af
packages/io-ts-http/src/httpRoute.ts
@@ -13,8 +13,10 @@ export const Method = t.keyof({
13
14
export type Method = t.TypeOf<typeof Method>;
15
16
+export type PathString = `/${string}`;
17
+
18
export type HttpRoute<M extends Method = Method> = {
- readonly path: string;
19
+ readonly path: PathString;
20
readonly method: Uppercase<M>;
21
readonly request: HttpRequestCodec<any>;
22
readonly response: HttpResponse;
packages/superagent-wrapper/src/request.ts
@@ -201,7 +201,7 @@ export const requestForRoute =
201
let path = route.path;
202
for (const key in reqProps.params) {
203
if (reqProps.params.hasOwnProperty(key)) {
204
- path = path.replace(`{${key}}`, reqProps.params[key]);
+ path = path.replace(`{${key}}`, reqProps.params[key]) as h.PathString;
205
}
206
207
0 commit comments