* Same as `s.appendRight(...)`, except that the inserted content will go *before* any previous appends or prepends at `index`
(index: number, content: string)
| 732 | * Same as `s.appendRight(...)`, except that the inserted content will go *before* any previous appends or prepends at `index` |
| 733 | */ |
| 734 | prependRight(index: number, content: string): this { |
| 735 | index = index + this.offset |
| 736 | |
| 737 | if (typeof content !== 'string') { |
| 738 | throw new MagicStringError(`content must be a string, got ${typeof content}`) |
| 739 | } |
| 740 | |
| 741 | if (DEBUG) |
| 742 | this.stats.time('insertRight') |
| 743 | |
| 744 | this._split(index) |
| 745 | |
| 746 | const chunk = this.byStart.get(index) |
| 747 | |
| 748 | if (chunk) { |
| 749 | chunk.prependRight(content) |
| 750 | } |
| 751 | else { |
| 752 | this.outro = content + this.outro |
| 753 | } |
| 754 | |
| 755 | if (DEBUG) |
| 756 | this.stats.timeEnd('insertRight') |
| 757 | return this |
| 758 | } |
| 759 | |
| 760 | /** |
| 761 | * Removes the characters from `start` to `end` (of the original string, **not** the generated string). |
no test coverage detected