File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,10 @@ export const Method = t.keyof({
1313
1414export type Method = t . TypeOf < typeof Method > ;
1515
16+ export type PathString = `/${string } `;
17+
1618export type HttpRoute < M extends Method = Method > = {
17- readonly path : string ;
19+ readonly path : PathString ;
1820 readonly method : Uppercase < M > ;
1921 readonly request : HttpRequestCodec < any > ;
2022 readonly response : HttpResponse ;
Original file line number Diff line number Diff 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 ] ) ;
204+ path = path . replace ( `{${ key } }` , reqProps . params [ key ] ) as h . PathString ;
205205 }
206206 }
207207
You can’t perform that action at this time.
0 commit comments