From 55920cabc81e16c160c20e89af1a585a9705e334 Mon Sep 17 00:00:00 2001 From: Benjamin Coe Date: Wed, 23 Oct 2019 17:09:22 -0700 Subject: [PATCH] fix: remove scheme from paths before joining --- 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)