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

Method _splitChunk

benchmark/data-min.js:552–568  ·  view source on GitHub ↗
(t, e)

Source from the content-addressed store, hash-verified

550 }
551 }
552 _splitChunk(t, e) {
553 if (t.edited && t.content.length) {
554 const i = C(this.original)(e);
555 throw new Error(
556 `Cannot split a chunk that has already been edited (${i.line}:${i.column} \u2013 "${t.original}")`,
557 );
558 }
559 const n = t.split(e);
560 return (
561 (this.byEnd[e] = t),
562 (this.byStart[e] = n),
563 (this.byEnd[n.end] = n),
564 t === this.lastChunk && (this.lastChunk = n),
565 (this.lastSearchedChunk = t),
566 !0
567 );
568 }
569 toString() {
570 let t = this.intro,
571 e = this.firstChunk;

Callers 2

indentMethod · 0.95
_splitMethod · 0.95

Calls 2

CFunction · 0.85
splitMethod · 0.45

Tested by

no test coverage detected