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

Method clone

benchmark/data-min.js:268–286  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

266 return (n ? n.appendRight(e) : (this.outro += e), this);
267 }
268 clone() {
269 const t = new f(this.original, { filename: this.filename });
270 let e = this.firstChunk,
271 n = (t.firstChunk = t.lastSearchedChunk = e.clone());
272 for (; e; ) {
273 ((t.byStart[n.start] = n), (t.byEnd[n.end] = n));
274 const i = e.next,
275 r = i && i.clone();
276 (r && ((n.next = r), (r.previous = n), (n = r)), (e = i));
277 }
278 return (
279 (t.lastChunk = n),
280 this.indentExclusionRanges && (t.indentExclusionRanges = this.indentExclusionRanges.slice()),
281 (t.sourcemapLocations = new p(this.sourcemapLocations)),
282 (t.intro = this.intro),
283 (t.outro = this.outro),
284 t
285 );
286 }
287 generateDecodedMap(t) {
288 t = t || {};
289 const e = 0,

Callers 1

snipMethod · 0.95

Calls 2

cloneMethod · 0.45
sliceMethod · 0.45

Tested by

no test coverage detected