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