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

Method generateMap

src/MagicString.ts:354–366  ·  view source on GitHub ↗

* Generates a version 3 sourcemap.

(options?: SourceMapOptions)

Source from the content-addressed store, hash-verified

352 * Generates a version 3 sourcemap.
353 */
354 generateMap(options?: SourceMapOptions): SourceMap {
355 options = options || {}
356
357 const encoder = new MappingsEncoder()
358 const mappings = new Mappings(options.hires, encoder)
359 const names = this._generateMappings(mappings)
360
361 return new SourceMap({
362 ...this._mapProperties(options, names),
363 mappings: encoder.finish(mappings.rawSegments),
364 rangeMappings: mappings.rawRangeMappings,
365 })
366 }
367
368 /** @internal */
369 _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