(text: string)
| 100 | } |
| 101 | |
| 102 | function normalizeText(text: string): string { |
| 103 | return text |
| 104 | .replace(/\r/g, '') |
| 105 | .replace(/[ \t\f\v]+/g, ' ') |
| 106 | .replace(/ *\n */g, '\n') |
| 107 | .replace(/\n{3,}/g, '\n\n') |
| 108 | .split('\n') |
| 109 | .map((line) => line.trim()) |
| 110 | .filter(Boolean) |
| 111 | .join('\n') |
| 112 | .trim() |
| 113 | } |
| 114 | |
| 115 | function extractFirstMatch(html: string, pattern: RegExp): string | undefined { |
| 116 | const match = html.match(pattern) |
no outgoing calls
no test coverage detected