Skip to content

Commit

Permalink
Restore FetchJsonResponse type
Browse files Browse the repository at this point in the history
  • Loading branch information
dpilafian committed Aug 14, 2024
1 parent 7a05322 commit fc92934
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fetch-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export type FetchJsonInit = { strictErrors: boolean };
export type FetchJsonOptions = RequestInit & Partial<FetchJsonInit>;
export type FetchJsonMethod = string;
export type FetchJsonParams = { [field: string]: string | number | boolean | null | undefined };
//export type FetchJsonParsedResponse = Json | any;
export type FetchJsonAltResponse = { //used when the HTTP response is an error or unexpectedly not JSON
ok: boolean, //code for HTTP status in the range 200-299
error: boolean, //code for HTTP status not in the range 200-299 or exception thrown
Expand All @@ -18,7 +17,7 @@ export type FetchJsonAltResponse = { //used when the HTTP response is an error
data: Json | null, //body of the HTTP responce if the content is JSON
response: Response, //response object
};
//export type FetchJsonResponse = FetchJsonParsedResponse | FetchJsonAltResponse;
export type FetchJsonResponse = Json | FetchJsonAltResponse;
export type FetchJsonLogger = (
dateIso: string, //timestamp, such as '2022-12-06T07:24:40.330Z'
type?: 'response' | 'request', //message direction
Expand Down

0 comments on commit fc92934

Please sign in to comment.