Skip to content
File

Blob: src/client/json.ts

typescript10 lines
1import type { JsonValue } from "@/shared/web";
2 
3export async function safeReadJson(response: Response): Promise<JsonValue | null> {
4 try {
5 return (await response.json()) as JsonValue;
6 } catch {
7 return null;
8 }
9}