travis-ci
4670 of 5656 branches covered (82.57%)
13 of 13 new or added lines in 2 files covered. (100.0%)
10412 of 11525 relevant lines covered (90.34%)
5850.54 hits per line
1 |
"use strict";
|
|
2 |
|
|
3 |
var path = require("path"); |
19 only 2387.2 ✔ |
4 |
|
|
5 |
function getRelativePath(absolutePath) { |
|
6 |
if (typeof window === "undefined") { |
|
7 |
absolutePath = path.resolve(process.cwd(), absolutePath); |
6,728 only 2387.2 ✔ |
8 |
return path.relative(process.cwd(), absolutePath);
|
6,728 only 2387.2 ✔ |
9 |
} else {
|
|
10 |
return absolutePath;
|
× |
11 |
} |
|
12 |
} |
|
13 |
|
|
14 |
class PosInfo {
|
|
15 |
constructor(path, line, column) { |
|
16 |
this.path = getRelativePath(path);
|
6,728 only 2387.2 ✔ |
17 |
this.line = line;
|
6,728 only 2387.2 ✔ |
18 |
this.column = column;
|
6,728 only 2387.2 ✔ |
19 |
} |
|
20 |
|
|
21 |
toString() { |
|
22 |
return (
|
1,290 only 2387.2 ✔ |
23 |
this.path +
|
|
24 |
(this.line != null ? ":" + this.line + ":" + this.column : "") |
|
25 |
); |
|
26 |
} |
|
27 |
} |
|
28 |
|
|
29 |
module.exports = PosInfo; |
19 only 2387.2 ✔ |