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

Method generateMap

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

* Generates a version 3 sourcemap.

(options?: SourceMapOptions)

Source from the content-addressed store, hash-verified

342 * Generates a version 3 sourcemap.
343 */
344 generateMap(options?: SourceMapOptions): SourceMap {
345 options = options || {}
346
347 const encoder = new MappingsEncoder()
348 const mappings = new Mappings(options.hires, encoder)
349 const names = this._generateMappings(mappings)
350
351 return new SourceMap({
352 ...this._mapProperties(options, names),
353 mappings: encoder.finish(mappings.rawSegments),
354 rangeMappings: mappings.rawRangeMappings,
355 })
356 }
357
358 /** @internal */
359 _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