From 10612faf2c37de28ac83216770c80f033a1a8fbe Mon Sep 17 00:00:00 2001 From: "Benjamin E. Coe" Date: Wed, 23 Oct 2019 17:13:18 -0700 Subject: [PATCH] fix: remove scheme from paths before joining (#69) --- lib/v8-to-istanbul.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/v8-to-istanbul.js b/lib/v8-to-istanbul.js index cc73355e..6c8d8392 100644 --- a/lib/v8-to-istanbul.js +++ b/lib/v8-to-istanbul.js @@ -49,9 +49,9 @@ module.exports = class V8ToIstanbul { if (rawSourceMap.sourcemap.sourceRoot && isAbsolute(rawSourceMap.sourcemap.sourceRoot)) { // TODO: we should also make source-root work with relative paths, but this needs // to be combined with the relativeTo logic which takes into account process.cwd(). - this.path = join(rawSourceMap.sourcemap.sourceRoot, rawSourceMap.sourcemap.sources[0]) + this.path = join(rawSourceMap.sourcemap.sourceRoot.replace('file://', ''), rawSourceMap.sourcemap.sources[0].replace('file://', '')) } else { - this.path = relativeTo(rawSourceMap.sourcemap.sources[0], this.path) + this.path = relativeTo(rawSourceMap.sourcemap.sources[0].replace('file://', ''), this.path) } this.sourceMap = await new SourceMapConsumer(rawSourceMap.sourcemap)