* Get the character index of the start of a line
(lineNumber: number)
| 525 | * Get the character index of the start of a line |
| 526 | */ |
| 527 | private getLineStart(lineNumber: number): number { |
| 528 | const lines = this.source.split('\n'); |
| 529 | let index = 0; |
| 530 | for (let i = 0; i < lineNumber - 1 && i < lines.length; i++) { |
| 531 | index += lines[i]!.length + 1; // +1 for newline |
| 532 | } |
| 533 | return index; |
| 534 | } |
| 535 | } |
no outgoing calls
no test coverage detected