(raw: string, maxLength = 240)
| 12 | * (e.g. `<` → `<` is a 4x expansion). |
| 13 | */ |
| 14 | export function escapeSlackText(raw: string, maxLength = 240): string { |
| 15 | const truncated = raw.length > maxLength ? `${raw.slice(0, maxLength)}…` : raw; |
| 16 | return truncated |
| 17 | .replace(/&/g, '&') |
| 18 | .replace(/</g, '<') |
| 19 | .replace(/>/g, '>'); |
| 20 | } |
no outgoing calls
no test coverage detected