( code: string, filePath: string, logger: Logger, )
| 200 | } |
| 201 | |
| 202 | export function extractSourcemapFromFile( |
| 203 | code: string, |
| 204 | filePath: string, |
| 205 | logger: Logger, |
| 206 | ): { code: string; map: SourceMap } | undefined { |
| 207 | const map = ( |
| 208 | convertSourceMap.fromSource(code) || |
| 209 | convertSourceMap.fromMapFileSource( |
| 210 | code, |
| 211 | createConvertSourceMapReadMap(filePath, logger), |
| 212 | ) |
| 213 | )?.toObject() |
| 214 | |
| 215 | if (map) { |
| 216 | return { |
| 217 | code: code.replace(convertSourceMap.mapFileCommentRegex, blankReplacer), |
| 218 | map, |
| 219 | } |
| 220 | } |
| 221 | } |
| 222 | |
| 223 | function createConvertSourceMapReadMap( |
| 224 | originalFileName: string, |
no test coverage detected