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

Class SourceMap

benchmark/data.js:140–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138 _btoa = btoa;
139}
140class SourceMap {
141 constructor(properties) {
142 this.version = 3;
143 this.file = properties.file;
144 this.sources = properties.sources;
145 this.sourcesContent = properties.sourcesContent;
146 this.names = properties.names;
147 this.mappings = encode(properties.mappings);
148 }
149 toString() {
150 return JSON.stringify(this);
151 }
152 toUrl() {
153 return 'data:application/json;charset=utf-8;base64,' + _btoa(this.toString());
154 }
155}
156function guessIndent(code) {
157 const lines = code.split('\n');
158 const tabbed = lines.filter((line) => /^\t+/.test(line));

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected