MCPcopy Create free account
hub / github.com/Rich-Harris/magic-string / generateMap

Method generateMap

src/MagicString.ts:356–368  ·  view source on GitHub ↗

* Generates a version 3 sourcemap.

(options?: SourceMapOptions)

Source from the content-addressed store, hash-verified

354 * Generates a version 3 sourcemap.
355 */
356 generateMap(options?: SourceMapOptions): SourceMap {
357 options = options || {}
358
359 const encoder = new MappingsEncoder()
360 const mappings = new Mappings(options.hires, encoder)
361 const names = this._generateMappings(mappings)
362
363 return new SourceMap({
364 ...this._mapProperties(options, names),
365 mappings: encoder.finish(mappings.rawSegments),
366 rangeMappings: mappings.rawRangeMappings,
367 })
368 }
369
370 /** @internal */
371 _generateMappings(mappings: Mappings): string[] {

Callers

nothing calls this directly

Calls 3

_generateMappingsMethod · 0.95
_mapPropertiesMethod · 0.95
finishMethod · 0.95

Tested by

no test coverage detected