mirror of
https://github.com/siteboon/claudecodeui.git
synced 2026-02-08 01:37:33 +00:00
fix: move safeJsonParse function to utils.js
This commit is contained in:
@@ -5,5 +5,11 @@ export function cn(...inputs) {
|
||||
return twMerge(clsx(inputs))
|
||||
}
|
||||
|
||||
// TODO: Add safeJsonParse here
|
||||
//
|
||||
export function safeJsonParse(value) {
|
||||
if (!value || typeof value !== 'string') return null;
|
||||
try {
|
||||
return JSON.parse(value);
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user