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

Method prependRight

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

Source from the content-addressed store, hash-verified

568 return this;
569 }
570 prependRight(index, content) {
571 if (typeof content !== 'string') throw new TypeError('inserted content must be a string');
572 this._split(index);
573 const chunk = this.byStart[index];
574 if (chunk) {
575 chunk.prependRight(content);
576 } else {
577 this.outro = content + this.outro;
578 }
579 return this;
580 }
581 remove(start, end) {
582 while (start < 0) start += this.original.length;
583 while (end < 0) end += this.original.length;

Callers 1

insertRightMethod · 0.95

Calls 2

_splitMethod · 0.95
prependRightMethod · 0.45

Tested by

no test coverage detected