| 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 }); |