Skip to content

Commit

Permalink
Revert "feat: add type error if path doesn't start with /"
Browse files Browse the repository at this point in the history
This reverts commit a27e388.
  • Loading branch information
bitgopatmcl committed Sep 13, 2024
1 parent e24ee18 commit db3b5fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions packages/io-ts-http/src/httpRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ export const Method = t.keyof({

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

export type PathString = `/${string}`;

export type HttpRoute<M extends Method = Method> = {
readonly path: PathString;
readonly path: string;
readonly method: Uppercase<M>;
readonly request: HttpRequestCodec<any>;
readonly response: HttpResponse;
Expand Down
2 changes: 1 addition & 1 deletion packages/superagent-wrapper/src/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export const requestForRoute =
let path = route.path;
for (const key in reqProps.params) {
if (reqProps.params.hasOwnProperty(key)) {
path = path.replace(`{${key}}`, reqProps.params[key]) as h.PathString;
path = path.replace(`{${key}}`, reqProps.params[key]);
}
}

Expand Down

0 comments on commit db3b5fa

Please sign in to comment.