Skip to content

Commit

Permalink
feat: add type error if path doesn't start with /
Browse files Browse the repository at this point in the history
  • Loading branch information
ad-world committed Aug 23, 2024
1 parent 19c4c76 commit 25b66e6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/io-ts-http/src/httpRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ 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: string;
readonly path: PathString;
readonly method: Uppercase<M>;
readonly request: HttpRequestCodec<any>;
readonly response: HttpResponse;
Expand Down

0 comments on commit 25b66e6

Please sign in to comment.