Skip to content

Commit 8db0195

Browse files
committedMay 4, 2022
fix: disable typecheck for h3 response (resolves #112)
1 parent da10a4c commit 8db0195

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed
 

‎src/event.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ export interface H3Event {
1212

1313
export type CompatibilityEvent = H3Event | IncomingMessage
1414

15-
interface JSONObject { [x: string]: JSONValue }
16-
interface JSONArray extends Array<JSONValue> { }
17-
export type JSONValue = undefined | null | string | number | boolean | JSONObject | JSONArray
18-
export type NonNullable<T> = T extends null | undefined ? never : T
19-
20-
type _H3Response = void | NonNullable<JSONValue> | Buffer
21-
export type H3Response = _H3Response | Promise<_H3Response>
15+
// interface JSONObject { [x: string]: JSONValue }
16+
// interface JSONArray extends Array<JSONValue> { }
17+
// type JSONValue = undefined | null | string | number | boolean | JSONObject | JSONArray
18+
// type NonNullable<T> = T extends null | undefined ? never : T
19+
// TODO: Find a more reliable way to typecheck Response with complex intefaces
20+
// https://github.com/unjs/h3/issues/112
21+
export type H3Response = any
2222

2323
export interface EventHandler<T extends H3Response = H3Response> {
2424
'__is_handler__'?: true

0 commit comments

Comments
 (0)
Please sign in to comment.