export default function (raw: string) { try { return JSON.parse(raw) as T; } catch { return null; } }