Files
Investidor-V2/resources/js/lib/value-text.ts
nala 287e991486
tests / ci (push) Waiting to run
oportunidades 7
2026-10-13 11:40:29 +02:00

9 lines
387 B
TypeScript

/** Display a saved JSON value without silently rendering objects as "[object Object]". */
export function valueText(value: unknown): string {
if (value === null || value === undefined) return '';
if (typeof value === 'string') return value;
if (typeof value === 'number' || typeof value === 'boolean')
return String(value);
return JSON.stringify(value) ?? '';
}