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

Method split

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

Source from the content-addressed store, hash-verified

69 this.intro = t + this.intro;
70 }
71 split(t) {
72 const e = t - this.start,
73 n = this.original.slice(0, e),
74 i = this.original.slice(e);
75 this.original = n;
76 const r = new g(t, this.end, i);
77 return (
78 (r.outro = this.outro),
79 (this.outro = ''),
80 (this.end = t),
81 this.edited ? (r.edit('', !1), (this.content = '')) : (this.content = n),
82 (r.next = this.next),
83 r.next && (r.next.previous = r),
84 (r.previous = this),
85 (this.next = r),
86 r
87 );
88 }
89 toString() {
90 return this.intro + this.content + this.outro;
91 }

Callers 9

trimEndMethod · 0.95
trimStartMethod · 0.95
LFunction · 0.45
EFunction · 0.45
CFunction · 0.45
advanceMethod · 0.45
generateDecodedMapMethod · 0.45
_splitChunkMethod · 0.45
generateDecodedMapMethod · 0.45

Calls 2

editMethod · 0.95
sliceMethod · 0.45

Tested by

no test coverage detected