Skip to content

Commit

Permalink
refactor(Patch): Loosen strictness of JSON type definition
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-ketch committed Feb 16, 2022
1 parent c72b569 commit 9f7a478
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions web/src/patches/checks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,17 @@ export function isComment(node: Node | null | undefined): node is Comment {
return node?.nodeType === Node.COMMENT_NODE
}

export type JsonObject = { [property: string | number]: JsonValue }

export type JsonValue =
| string
| number
| boolean
| null
| JsonObject
| JsonValue[]
| { [key: string]: JsonValue }

export type JsonArray = JsonValue[]
export type JsonObject = { [key: string]: JsonValue }

/**
* Assert that a JSON value is defined.
Expand Down

0 comments on commit 9f7a478

Please sign in to comment.