export const escapeHtml = (s: unknown): string => String(s ?? '') .replace(/&/g, '&') .replace(//g, '>') .replace(/"/g, '"') .replace(/'/g, ''') export const formatEur = (n: unknown): string => { const num = typeof n === 'number' ? n : Number(n ?? 0) if (!Number.isFinite(num)) return '—' return new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR', }).format(num) } export const formatDateDe = (d: string | Date): string => { const date = typeof d === 'string' ? new Date(d) : d return new Intl.DateTimeFormat('de-DE', { day: '2-digit', month: 'long', year: 'numeric', }).format(date) } export const baseDocument = (title: string, body: string): string => `
| Name | Rolle | Anteile |
|---|