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

Method generateDecodedMap

benchmark/data-min.js:723–759  ·  view source on GitHub ↗
(t = {})

Source from the content-addressed store, hash-verified

721 );
722 }
723 generateDecodedMap(t = {}) {
724 const e = [];
725 this.sources.forEach((i) => {
726 Object.keys(i.content.storedNames).forEach((r) => {
727 ~e.indexOf(r) || e.push(r);
728 });
729 });
730 const n = new y(t.hires);
731 return (
732 this.intro && n.advance(this.intro),
733 this.sources.forEach((i, r) => {
734 r > 0 && n.advance(this.separator);
735 const s = i.filename ? this.uniqueSourceIndexByFilename[i.filename] : -1,
736 h = i.content,
737 o = C(h.original);
738 (h.intro && n.advance(h.intro),
739 h.firstChunk.eachNext((a) => {
740 const u = o(a.start);
741 (a.intro.length && n.advance(a.intro),
742 i.filename
743 ? a.edited
744 ? n.addEdit(s, a.content, u, a.storeName ? e.indexOf(a.original) : -1)
745 : n.addUneditedChunk(s, a, h.original, u, h.sourcemapLocations)
746 : n.advance(a.content),
747 a.outro.length && n.advance(a.outro));
748 }),
749 h.outro && n.advance(h.outro));
750 }),
751 {
752 file: t.file ? t.file.split(/[/\\]/).pop() : null,
753 sources: this.uniqueSources.map((i) => (t.file ? E(t.file, i.filename) : i.filename)),
754 sourcesContent: this.uniqueSources.map((i) => (t.includeContent ? i.content : null)),
755 names: e,
756 mappings: n.raw,
757 }
758 );
759 }
760 generateMap(t) {
761 return new b(this.generateDecodedMap(t));
762 }

Callers 1

generateMapMethod · 0.95

Calls 7

advanceMethod · 0.95
addEditMethod · 0.95
addUneditedChunkMethod · 0.95
CFunction · 0.85
EFunction · 0.85
eachNextMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected