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

Method appendLeft

benchmark/data.js:306–316  ·  view source on GitHub ↗
(index, content)

Source from the content-addressed store, hash-verified

304 return this;
305 }
306 appendLeft(index, content) {
307 if (typeof content !== 'string') throw new TypeError('inserted content must be a string');
308 this._split(index);
309 const chunk = this.byEnd[index];
310 if (chunk) {
311 chunk.appendLeft(content);
312 } else {
313 this.intro += content;
314 }
315 return this;
316 }
317 appendRight(index, content) {
318 if (typeof content !== 'string') throw new TypeError('inserted content must be a string');
319 this._split(index);

Callers 1

insertLeftMethod · 0.95

Calls 2

_splitMethod · 0.95
appendLeftMethod · 0.45

Tested by

no test coverage detected