mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-22 17:00:14 +08:00
8 lines
132 B
TypeScript
8 lines
132 B
TypeScript
export function safeParseJson(text: string): unknown | null {
|
|
try {
|
|
return JSON.parse(text)
|
|
} catch {
|
|
return null
|
|
}
|
|
}
|