File tree Expand file tree Collapse file tree 2 files changed +14
-9
lines changed
Expand file tree Collapse file tree 2 files changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -88,8 +88,13 @@ describe("zod v4", () => {
8888 } ) ,
8989 validator ( "json" , z . object ( { message : z . string ( ) } ) ) ,
9090 describeResponse (
91- ( c ) => {
92- return c . json ( { error : "some" } , 400 ) ;
91+ async ( c ) => {
92+ try {
93+ return c . json ( { message : "Hello World" } , 200 ) ;
94+ } catch ( e ) {
95+ console . error ( e ) ;
96+ return c . json ( { error : e . message } , 400 ) ;
97+ }
9398 } ,
9499 {
95100 200 : {
Original file line number Diff line number Diff line change @@ -148,16 +148,16 @@ type HandlerResponse<
148148 T extends Partial < Record < StatusCode , StandardSchemaV1 > > = Partial <
149149 Record < StatusCode , StandardSchemaV1 >
150150 > ,
151- > = {
152- [ K in keyof T ] : T [ K ] extends StandardSchemaV1
153- ? PromiseOr <
154- TypedResponse <
151+ > = PromiseOr <
152+ {
153+ [ K in keyof T ] : T [ K ] extends StandardSchemaV1
154+ ? TypedResponse <
155155 StandardSchemaV1 . InferOutput < T [ K ] > ,
156156 Num < K > extends StatusCode ? Num < K > : never
157157 >
158- >
159- : never ;
160- } [ keyof T ] ;
158+ : never ;
159+ } [ keyof T ]
160+ > ;
161161
162162export type Handler <
163163 E extends Env ,
You can’t perform that action at this time.
0 commit comments