(text: string, max = 90)
| 83 | } |
| 84 | |
| 85 | function formatPreview(text: string, max = 90): string { |
| 86 | const cleaned = text.replace(/\s+/g, " ").trim(); |
| 87 | return cleaned.length > max ? `${cleaned.slice(0, max - 1)}…` : cleaned; |
| 88 | } |
| 89 | |
| 90 | function mean(values: number[]): number { |
| 91 | if (values.length === 0) return 0; |