( id: string, originalCode: string, originalSourcemap: ExistingDecodedSourceMap | null, sourcemapChain: readonly DecodedSourceMapOrMissing[], log: LogHandler )
| 244 | } |
| 245 | |
| 246 | export function collapseSourcemap( |
| 247 | id: string, |
| 248 | originalCode: string, |
| 249 | originalSourcemap: ExistingDecodedSourceMap | null, |
| 250 | sourcemapChain: readonly DecodedSourceMapOrMissing[], |
| 251 | log: LogHandler |
| 252 | ): ExistingDecodedSourceMap | null { |
| 253 | if (sourcemapChain.length === 0) { |
| 254 | return originalSourcemap; |
| 255 | } |
| 256 | |
| 257 | const source = getCollapsedSourcemap( |
| 258 | id, |
| 259 | originalCode, |
| 260 | originalSourcemap, |
| 261 | sourcemapChain, |
| 262 | getLinkMap(log) |
| 263 | ) as Link; |
| 264 | const map = source.traceMappings(); |
| 265 | return decodedSourcemap({ version: 3, ...map }); |
| 266 | } |
no test coverage detected
searching dependent graphs…