Skip to content

Commit

Permalink
fix(types): fix JSONValue type (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Apr 22, 2022
1 parent bb5a867 commit e9a07cb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ export interface H3Event {

export type CompatibilityEvent = H3Event | IncomingMessage

type _JSONValue<T=string|number|boolean> = T | T[] | Record<string, T>
export type JSONValue = _JSONValue<_JSONValue>
interface JSONObject { [x: string]: JSONValue }
interface JSONArray extends Array<JSONValue> { }
export type JSONValue = string | number | boolean | JSONObject | JSONArray

type _H3Response = void | JSONValue | Buffer
export type H3Response = _H3Response | Promise<_H3Response>
Expand Down

0 comments on commit e9a07cb

Please sign in to comment.