(options)
| 351 | return cloned; |
| 352 | } |
| 353 | generateDecodedMap(options) { |
| 354 | options = options || {}; |
| 355 | const sourceIndex = 0; |
| 356 | const names = Object.keys(this.storedNames); |
| 357 | const mappings = new Mappings(options.hires); |
| 358 | const locate = getLocator(this.original); |
| 359 | if (this.intro) { |
| 360 | mappings.advance(this.intro); |
| 361 | } |
| 362 | this.firstChunk.eachNext((chunk) => { |
| 363 | const loc = locate(chunk.start); |
| 364 | if (chunk.intro.length) mappings.advance(chunk.intro); |
| 365 | if (chunk.edited) { |
| 366 | mappings.addEdit( |
| 367 | sourceIndex, |
| 368 | chunk.content, |
| 369 | loc, |
| 370 | chunk.storeName ? names.indexOf(chunk.original) : -1, |
| 371 | ); |
| 372 | } else { |
| 373 | mappings.addUneditedChunk(sourceIndex, chunk, this.original, loc, this.sourcemapLocations); |
| 374 | } |
| 375 | if (chunk.outro.length) mappings.advance(chunk.outro); |
| 376 | }); |
| 377 | return { |
| 378 | file: options.file ? options.file.split(/[/\\]/).pop() : null, |
| 379 | sources: [options.source ? getRelativePath(options.file || '', options.source) : null], |
| 380 | sourcesContent: options.includeContent ? [this.original] : [null], |
| 381 | names, |
| 382 | mappings: mappings.raw, |
| 383 | }; |
| 384 | } |
| 385 | generateMap(options) { |
| 386 | return new SourceMap(this.generateDecodedMap(options)); |
| 387 | } |
no test coverage detected