File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 11import type { StreamChannelRef } from './iii-types'
2- import type { HttpRequest , HttpResponse , InternalHttpRequest } from './types'
2+ import type { ApiResponse , HttpRequest , HttpResponse , InternalHttpRequest } from './types'
33
44/**
55 * Safely stringify a value, handling circular references, BigInt, and other edge cases.
@@ -30,7 +30,10 @@ export function safeStringify(value: unknown): string {
3030 }
3131}
3232
33- export const http = ( callback : ( req : HttpRequest , res : HttpResponse ) => Promise < void > ) => {
33+ export const http = (
34+ // biome-ignore lint/suspicious/noConfusingVoidType: void is necessary here
35+ callback : ( req : HttpRequest , res : HttpResponse ) => Promise < void | ApiResponse > ,
36+ ) => {
3437 return async ( req : InternalHttpRequest ) => {
3538 const { response, ...request } = req
3639
@@ -43,7 +46,7 @@ export const http = (callback: (req: HttpRequest, res: HttpResponse) => Promise<
4346 close : ( ) => response . close ( ) ,
4447 }
4548
46- await callback ( request , httpResponse )
49+ return callback ( request , httpResponse )
4750 }
4851}
4952
You can’t perform that action at this time.
0 commit comments