| 579 | return this; |
| 580 | } |
| 581 | remove(start, end) { |
| 582 | while (start < 0) start += this.original.length; |
| 583 | while (end < 0) end += this.original.length; |
| 584 | if (start === end) return this; |
| 585 | if (start < 0 || end > this.original.length) throw new Error('Character is out of bounds'); |
| 586 | if (start > end) throw new Error('end must be greater than start'); |
| 587 | this._split(start); |
| 588 | this._split(end); |
| 589 | let chunk = this.byStart[start]; |
| 590 | while (chunk) { |
| 591 | chunk.intro = ''; |
| 592 | chunk.outro = ''; |
| 593 | chunk.edit(''); |
| 594 | chunk = end > chunk.end ? this.byStart[chunk.end] : null; |
| 595 | } |
| 596 | return this; |
| 597 | } |
| 598 | lastChar() { |
| 599 | if (this.outro.length) return this.outro[this.outro.length - 1]; |
| 600 | let chunk = this.lastChunk; |