* Same as `s.appendRight(...)`, except that the inserted content will go *before* any previous appends or prepends at `index`
(index: number, content: string)
| 866 | * Same as `s.appendRight(...)`, except that the inserted content will go *before* any previous appends or prepends at `index` |
| 867 | */ |
| 868 | prependRight(index: number, content: string): this { |
| 869 | index = this._resolveIndex(index) |
| 870 | if (index < 0 || index > this.original.length) { |
| 871 | throw new MagicStringError(`index ${index} is out of bounds`) |
| 872 | } |
| 873 | |
| 874 | if (typeof content !== 'string') { |
| 875 | throw new MagicStringError(`content must be a string, got ${typeof content}`) |
| 876 | } |
| 877 | |
| 878 | this._split(index) |
| 879 | |
| 880 | const chunk = this.byStart.get(index) |
| 881 | |
| 882 | if (chunk) { |
| 883 | chunk.prependRight(content) |
| 884 | } |
| 885 | else { |
| 886 | this.outro = content + this.outro |
| 887 | } |
| 888 | |
| 889 | return this |
| 890 | } |
| 891 | |
| 892 | /** |
| 893 | * Removes the characters from `start` to `end` (of the original string, **not** the generated string). |
no test coverage detected