Skip to content

Commit bc2ad85

Browse files
fix: Check for inputSourceMap existing before regex execution (#874)
Co-authored-by: Jennifer Shehane <[email protected]>
1 parent 5670f05 commit bc2ad85

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 (!inputSourceMap) 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)