Skip to content

Commit db3b5fa

Browse files
committed
Revert "feat: add type error if path doesn't start with /"
This reverts commit a27e388.
1 parent e24ee18 commit db3b5fa

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

packages/io-ts-http/src/httpRoute.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@ export const Method = t.keyof({
1313

1414
export type Method = t.TypeOf<typeof Method>;
1515

16-
export type PathString = `/${string}`;
17-
1816
export type HttpRoute<M extends Method = Method> = {
19-
readonly path: PathString;
17+
readonly path: string;
2018
readonly method: Uppercase<M>;
2119
readonly request: HttpRequestCodec<any>;
2220
readonly response: HttpResponse;

packages/superagent-wrapper/src/request.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ export const requestForRoute =
201201
let path = route.path;
202202
for (const key in reqProps.params) {
203203
if (reqProps.params.hasOwnProperty(key)) {
204-
path = path.replace(`{${key}}`, reqProps.params[key]) as h.PathString;
204+
path = path.replace(`{${key}}`, reqProps.params[key]);
205205
}
206206
}
207207

0 commit comments

Comments
 (0)