* Same as `s.appendLeft(...)`, except that the inserted content will go *before* any previous appends or prepends at index
(index: number, content: string)
| 839 | * Same as `s.appendLeft(...)`, except that the inserted content will go *before* any previous appends or prepends at index |
| 840 | */ |
| 841 | prependLeft(index: number, content: string): this { |
| 842 | index = this._resolveIndex(index) |
| 843 | if (index < 0 || index > this.original.length) { |
| 844 | throw new MagicStringError(`index ${index} is out of bounds`) |
| 845 | } |
| 846 | |
| 847 | if (typeof content !== 'string') { |
| 848 | throw new MagicStringError(`content must be a string, got ${typeof content}`) |
| 849 | } |
| 850 | |
| 851 | this._split(index) |
| 852 | |
| 853 | const chunk = this.byEnd.get(index) |
| 854 | |
| 855 | if (chunk) { |
| 856 | chunk.prependLeft(content) |
| 857 | } |
| 858 | else { |
| 859 | this.intro = content + this.intro |
| 860 | } |
| 861 | |
| 862 | return this |
| 863 | } |
| 864 | |
| 865 | /** |
| 866 | * Same as `s.appendRight(...)`, except that the inserted content will go *before* any previous appends or prepends at `index` |
nothing calls this directly
no test coverage detected