export function toPlainObject(value: T): Record { if (value === null || typeof value !== 'object') { return {}; } try { return JSON.parse(JSON.stringify(value)); } catch (e) { return {}; } }