Skip to content

Commit

Permalink
Add isProblemDetails helper
Browse files Browse the repository at this point in the history
  • Loading branch information
htunnicliff committed Oct 31, 2023
1 parent 21a13a8 commit 2db15b2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,4 +413,14 @@ 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
);
}
}

0 comments on commit 2db15b2

Please sign in to comment.