(filePath: string)
| 17 | private lines: string[] |
| 18 | |
| 19 | static read(filePath: string): SourceFileSlice | null { |
| 20 | let content: string |
| 21 | try { |
| 22 | content = fs.readFileSync(filePath, 'utf-8') |
| 23 | } catch (e) { |
| 24 | return null |
| 25 | } |
| 26 | |
| 27 | return SourceFileSlice.fromContent(content) |
| 28 | } |
| 29 | |
| 30 | static fromContent(content: string): SourceFileSlice { |
| 31 | const lines = content.split(/\r?\n/) |
no test coverage detected