12345678910111213141516171819202122232425262728293031323334 |
- module.exports = class CovLine {
- constructor (line, startCol, lineStr) {
- this.line = line
-
-
- this.startCol = startCol
-
-
- const matchedNewLineChar = lineStr.match(/\r?\n$/u)
- const newLineLength = matchedNewLineChar ? matchedNewLineChar[0].length : 0
- this.endCol = startCol + lineStr.length - newLineLength
-
-
- this.count = 1
-
- this.ignore = false
- }
- toIstanbul () {
- return {
- start: {
- line: this.line,
- column: 0
- },
- end: {
- line: this.line,
- column: this.endCol - this.startCol
- }
- }
- }
- }
|