| 269 | } |
| 270 | |
| 271 | generateMap( |
| 272 | options: BundleSourceMapOptions = {}, |
| 273 | ): Omit<SourceMap, 'sourcesContent'> & { sourcesContent: Array<string | null> } { |
| 274 | const encoder = new MappingsEncoder() |
| 275 | const mappings = new Mappings(options.hires, encoder) |
| 276 | const { names, x_google_ignoreList } = this._generateMappings(mappings) |
| 277 | |
| 278 | // bundle maps always provide sourcesContent, while SourceMap types it as optional |
| 279 | return new SourceMap({ |
| 280 | ...this._mapProperties(options, names, x_google_ignoreList), |
| 281 | mappings: encoder.finish(mappings.rawSegments), |
| 282 | rangeMappings: mappings.rawRangeMappings, |
| 283 | }) as Omit<SourceMap, 'sourcesContent'> & { |
| 284 | sourcesContent: Array<string | null> |
| 285 | } |
| 286 | } |
| 287 | |
| 288 | /** @internal */ |
| 289 | _generateMappings(mappings: Mappings): { names: string[], x_google_ignoreList: number[] | undefined } { |