Skip to content

Commit

Permalink
Improve JSON typings
Browse files Browse the repository at this point in the history
Change-type: patch
  • Loading branch information
Page- committed Mar 21, 2024
1 parent d581115 commit 4870006
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/types/json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,19 @@ export const types = {
},
};

type ReadType = Record<string, any> | any[];
type WriteType = Record<string, any> | any[];
type JSON = string | number | boolean | null | JSON[] | { [key: string]: JSON };
type JSONable =
| string
| number
| boolean
| null
| undefined
| JSONable[]
| { [key: string]: JSONable }
| { toJSON(): JSONable };

type ReadType = { [key: string]: JSON } | JSON[];
type WriteType = { [key: string]: JSONable } | JSONable[];
type DbWriteType = string;

export const fetchProcessing: TypeUtils.FetchProcessing<ReadType> = (data) => {
Expand Down

0 comments on commit 4870006

Please sign in to comment.