Skip to content

Commit

Permalink
Merge pull request #901 from BitGo/revert-leading-slash-type-change
Browse files Browse the repository at this point in the history
Revert "feat: add type error if path doesn't start with /"
  • Loading branch information
bitgopatmcl authored Sep 13, 2024
2 parents e24ee18 + db3b5fa commit f1f80af
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 f1f80af

Please sign in to comment.