export function safeJSONParse(json: string, defaultValue: T): T { try { return JSON.parse(json); } catch { return defaultValue; } }