Skip to content

Commit fc6e289

Browse files
authoredMar 23, 2020
refactor: remove isAbsolute and replace with path.isAbsolute (#405)
path.isAbsolute added in node v0.11.2
1 parent 83bafc3 commit fc6e289

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed
 

‎lib/reporter.js

+1-9
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,6 @@ var globalCoverageMap = require('./coverage-map')
2020
var reports = require('./report-creator')
2121
const hasOwnProperty = Object.prototype.hasOwnProperty
2222

23-
function isAbsolute (file) {
24-
if (path.isAbsolute) {
25-
return path.isAbsolute(file)
26-
}
27-
28-
return path.resolve(file) === path.normalize(file)
29-
}
30-
3123
// TODO(vojta): inject only what required (config.basePath, config.coverageReporter)
3224
var CoverageReporter = function (rootConfig, helper, logger, emitter) {
3325
var log = logger.create('coverage')
@@ -58,7 +50,7 @@ var CoverageReporter = function (rootConfig, helper, logger, emitter) {
5850

5951
function normalize (key) {
6052
// Exclude keys will always be relative, but covObj keys can be absolute or relative
61-
var excludeKey = isAbsolute(key) ? path.relative(basePath, key) : key
53+
var excludeKey = path.isAbsolute(key) ? path.relative(basePath, key) : key
6254
// Also normalize for files that start with `./`, etc.
6355
excludeKey = path.normalize(excludeKey)
6456

0 commit comments

Comments
 (0)
Please sign in to comment.