* Get the character index of the start of a line
(lineNumber: number)
| 383 | * Get the character index of the start of a line |
| 384 | */ |
| 385 | private getLineStart(lineNumber: number): number { |
| 386 | const lines = this.source.split('\n'); |
| 387 | let index = 0; |
| 388 | for (let i = 0; i < lineNumber - 1 && i < lines.length; i++) { |
| 389 | index += lines[i]!.length + 1; // +1 for newline |
| 390 | } |
| 391 | return index; |
| 392 | } |
| 393 | } |
no outgoing calls
no test coverage detected