Skip to content

Commit

Permalink
Simplify problem details resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
htunnicliff committed Oct 31, 2023
1 parent 2cfd087 commit 9ca2a36
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
8 changes: 1 addition & 7 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,12 +415,6 @@ export class JamClient<Config extends ClientConfig = ClientConfig> {
}

static isProblemDetails(value: unknown): value is JMAP.ProblemDetails {
return (
typeof value === "object" &&
value !== null &&
"type" in value &&
"status" in value &&
"detail" in value
);
return typeof value === "object" && value !== null && "type" in value;
}
}
4 changes: 2 additions & 2 deletions src/types/jmap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ export type ResultReference = {
*/
export type ProblemDetails = {
type: string;
status: number;
detail: string;
status?: number;
detail?: string;
instance?: string;
methodCallId?: string;
};
Expand Down

0 comments on commit 9ca2a36

Please sign in to comment.