Skip to content

Commit 7ef3147

Browse files
committed
Check for inputSourceMap existing before regex execution
1 parent 32a2f8d commit 7ef3147

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

support-utils.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,9 @@ const filterSupportFilesFromCoverage = (
137137
function fixSourcePaths(coverage) {
138138
Object.values(coverage).forEach((file) => {
139139
const { path: absolutePath, inputSourceMap } = file
140+
if (!absolutePath) return
140141
const fileName = /([^\/\\]+)$/.exec(absolutePath)[1]
141-
if (!inputSourceMap || !fileName) return
142+
if (!fileName) return
142143

143144
if (inputSourceMap.sourceRoot) inputSourceMap.sourceRoot = ''
144145
inputSourceMap.sources = inputSourceMap.sources.map((source) =>

0 commit comments

Comments
 (0)