(map: DecodedSourceMap | string)
| 43 | } |
| 44 | |
| 45 | export function toSourceMap(map: DecodedSourceMap | string): SourceMap { |
| 46 | let raw = typeof map === 'string' ? map : serializeSourceMap(map) |
| 47 | |
| 48 | function comment(url: string) { |
| 49 | return `/*# sourceMappingURL\x3d${url} */\n` |
| 50 | } |
| 51 | |
| 52 | return { |
| 53 | raw, |
| 54 | get inline() { |
| 55 | let inlined = Buffer.from(raw, 'utf-8').toString('base64') |
| 56 | return comment(`data:application/json;base64,${inlined}`) |
| 57 | }, |
| 58 | comment, |
| 59 | } |
| 60 | } |
no test coverage detected