* Same as `s.appendRight(...)`, except that the inserted content will go *before* any previous appends or prepends at `index`
(index: number, content: string)
| 699 | * Same as `s.appendRight(...)`, except that the inserted content will go *before* any previous appends or prepends at `index` |
| 700 | */ |
| 701 | prependRight(index: number, content: string): this { |
| 702 | index = index + this.offset |
| 703 | |
| 704 | if (typeof content !== 'string') { |
| 705 | throw new MagicStringError(`content must be a string, got ${typeof content}`) |
| 706 | } |
| 707 | |
| 708 | if (DEBUG) |
| 709 | this.stats.time('insertRight') |
| 710 | |
| 711 | this._split(index) |
| 712 | |
| 713 | const chunk = this.byStart.get(index) |
| 714 | |
| 715 | if (chunk) { |
| 716 | chunk.prependRight(content) |
| 717 | } |
| 718 | else { |
| 719 | this.outro = content + this.outro |
| 720 | } |
| 721 | |
| 722 | if (DEBUG) |
| 723 | this.stats.timeEnd('insertRight') |
| 724 | return this |
| 725 | } |
| 726 | |
| 727 | /** |
| 728 | * Removes the characters from `start` to `end` (of the original string, **not** the generated string). |
no test coverage detected