Skip to content

Commit 182b224

Browse files
authoredApr 29, 2022
fix(types): nullables object props for response (#111)
1 parent 46fa4d5 commit 182b224

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎src/event.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ export type CompatibilityEvent = H3Event | IncomingMessage
1414

1515
interface JSONObject { [x: string]: JSONValue }
1616
interface JSONArray extends Array<JSONValue> { }
17-
export type JSONValue = string | number | boolean | JSONObject | JSONArray
17+
export type JSONValue = undefined | null | string | number | boolean | JSONObject | JSONArray
18+
export type NonNullable<T> = T extends null | undefined ? never : T
1819

19-
type _H3Response = void | JSONValue | Buffer
20+
type _H3Response = void | NonNullable<JSONValue> | Buffer
2021
export type H3Response = _H3Response | Promise<_H3Response>
2122

2223
export interface EventHandler<T extends H3Response = H3Response> {

0 commit comments

Comments
 (0)
Please sign in to comment.