From 25b66e6433476eb99d4a8b77232f8ef61d9f7dfa Mon Sep 17 00:00:00 2001 From: Aryaman Dhingra Date: Fri, 23 Aug 2024 10:36:45 -0400 Subject: [PATCH] feat: add type error if path doesn't start with / DX-703 --- packages/io-ts-http/src/httpRoute.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/io-ts-http/src/httpRoute.ts b/packages/io-ts-http/src/httpRoute.ts index a2384299..f18aed71 100644 --- a/packages/io-ts-http/src/httpRoute.ts +++ b/packages/io-ts-http/src/httpRoute.ts @@ -13,8 +13,10 @@ export const Method = t.keyof({ export type Method = t.TypeOf; +export type PathString = `/${string}`; + export type HttpRoute = { - readonly path: string; + readonly path: PathString; readonly method: Uppercase; readonly request: HttpRequestCodec; readonly response: HttpResponse;