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

Method _split

benchmark/data-min.js:543–551  ·  view source on GitHub ↗
(t)

Source from the content-addressed store, hash-verified

541 return (n.remove(0, t), n.remove(e, n.original.length), n);
542 }
543 _split(t) {
544 if (this.byStart[t] || this.byEnd[t]) return;
545 let e = this.lastSearchedChunk;
546 const n = t > e.end;
547 for (; e; ) {
548 if (e.contains(t)) return this._splitChunk(e, t);
549 e = n ? this.byStart[e.end] : this.byEnd[e.start];
550 }
551 }
552 _splitChunk(t, e) {
553 if (t.edited && t.content.length) {
554 const i = C(this.original)(e);

Callers 7

appendLeftMethod · 0.95
appendRightMethod · 0.95
moveMethod · 0.95
overwriteMethod · 0.95
prependLeftMethod · 0.95
prependRightMethod · 0.95
removeMethod · 0.95

Calls 2

_splitChunkMethod · 0.95
containsMethod · 0.45

Tested by

no test coverage detected