(s)
| 118 | * non-strings and empty strings are returned unchanged. |
| 119 | */ |
| 120 | export function sanitizeText(s) { |
| 121 | if (typeof s !== 'string' || !s) return s; |
| 122 | let out = s; |
| 123 | for (const [re, rep] of PATTERNS) out = out.replace(re, rep); |
| 124 | return out; |
| 125 | } |
| 126 | |
| 127 | /** |
| 128 | * Incremental sanitizer for streamed deltas. |
no outgoing calls
no test coverage detected