(text: string)
| 3 | const EM_DASH = '\u2014'; |
| 4 | |
| 5 | function escapeHtml(text: string): string { |
| 6 | // Escapes text for safe insertion into HTML text/attribute contexts. |
| 7 | // (We only use it for text nodes here, but keeping it generic is fine.) |
| 8 | return text |
| 9 | .replace(/&/g, '&') |
| 10 | .replace(/</g, '<') |
| 11 | .replace(/>/g, '>') |
| 12 | .replace(/"/g, '"') |
| 13 | .replace(/'/g, '''); |
| 14 | } |
| 15 | |
| 16 | function formatNumber(value: number): string { |
| 17 | if (!Number.isFinite(value)) return EM_DASH; |
no outgoing calls
no test coverage detected