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

Method appendRight

src/MagicString.js:81–100  ·  view source on GitHub ↗
(index, content)

Source from the content-addressed store, hash-verified

79 }
80
81 appendRight(index, content) {
82 index = index + this.offset;
83
84 if (typeof content !== 'string') throw new TypeError('inserted content must be a string');
85
86 if (DEBUG) this.stats.time('appendRight');
87
88 this._split(index);
89
90 const chunk = this.byStart[index];
91
92 if (chunk) {
93 chunk.appendRight(content);
94 } else {
95 this.outro += content;
96 }
97
98 if (DEBUG) this.stats.timeEnd('appendRight');
99 return this;
100 }
101
102 clone() {
103 const cloned = new MagicString(this.original, { filename: this.filename, offset: this.offset });

Callers

nothing calls this directly

Calls 3

_splitMethod · 0.95
timeMethod · 0.80
timeEndMethod · 0.80

Tested by

no test coverage detected