(strings: TemplateStringsArray, ...values: any[])
| 141 | * 2. The `<..>` is a placeholder that will allow for arbitrary content. |
| 142 | */ |
| 143 | export function changelogPattern(strings: TemplateStringsArray, ...values: any[]): RegExp { |
| 144 | return new RegExp( |
| 145 | sanitizeForRegularExpression(dedent(strings, ...values).trim()).replace(/<\\.\\.>/g, '.*?'), |
| 146 | 'g', |
| 147 | ); |
| 148 | } |
| 149 | |
| 150 | /** Sanitizes a given string so that it can be used as literal in a RegExp. */ |
| 151 | function sanitizeForRegularExpression(value: string): string { |
no test coverage detected