* Externalize the source map.
()
| 405 | * Externalize the source map. |
| 406 | */ |
| 407 | toJSON() { |
| 408 | const map = { |
| 409 | version: this._version, |
| 410 | sources: this._sources.toArray(), |
| 411 | names: this._names.toArray(), |
| 412 | mappings: this._serializeMappings(), |
| 413 | }; |
| 414 | if (this._file != null) { |
| 415 | map.file = this._file; |
| 416 | } |
| 417 | if (this._sourceRoot != null) { |
| 418 | map.sourceRoot = this._sourceRoot; |
| 419 | } |
| 420 | if (this._sourcesContents) { |
| 421 | map.sourcesContent = this._generateSourcesContent( |
| 422 | map.sources, |
| 423 | map.sourceRoot |
| 424 | ); |
| 425 | } |
| 426 | |
| 427 | return map; |
| 428 | } |
| 429 | |
| 430 | /** |
| 431 | * Render the source map being generated to a string. |
no test coverage detected