export function parseJson(val: unknown): Record<string, unknown> {
  if (typeof val === "string") {
    try {
      return JSON.parse(val);
    } catch {
      return {};
    }
  }
  return (val as Record<string, unknown>) ?? {};
}
