(input: string)
| 643 | } |
| 644 | |
| 645 | function getVariablesMatches(input: string): VariableMatch[] { |
| 646 | const ranges: VariableMatch[] = []; |
| 647 | let i = 0; |
| 648 | let range: Range | null; |
| 649 | while ((range = getVariableRange(input, i))) { |
| 650 | const {start, end} = range; |
| 651 | ranges.push({start, end, value: input.substring(start, end)}); |
| 652 | i = range.end + 1; |
| 653 | } |
| 654 | return ranges; |
| 655 | } |
| 656 | |
| 657 | function replaceVariablesMatches(input: string, replacer: (match: string, count: number) => string | null) { |
| 658 | const matches = getVariablesMatches(input); |
no test coverage detected