(pattern: string)
| 195 | } |
| 196 | |
| 197 | function buildRegex(pattern: string): RegExp { |
| 198 | try { |
| 199 | return new RegExp(pattern, 'i') |
| 200 | } catch { |
| 201 | return new RegExp(escapeRegExp(pattern), 'i') |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | function snippetAround(text: string, regex: RegExp, maxChars: number): string { |
| 206 | const m = regex.exec(text) |
no test coverage detected