Sylvain Filoni
update gradio client
9ada4bc
raw
history blame contribute delete
270 Bytes
/**
* Parses a given string into JSON.
* Gracefully handles invalid JSON by returning `null`.
*/
export function parseJson(data: string): Record<string, unknown> | null {
try {
const json = JSON.parse(data)
return json
} catch (_) {
return null
}
}