* Same as `s.appendLeft(...)`, except that the inserted content will go *before* any previous appends or prepends at index
(index: number, content: string)
| 661 | * Same as `s.appendLeft(...)`, except that the inserted content will go *before* any previous appends or prepends at index |
| 662 | */ |
| 663 | prependLeft(index: number, content: string): this { |
| 664 | index = index + this.offset |
| 665 | |
| 666 | if (typeof content !== 'string') |
| 667 | throw new TypeError('inserted content must be a string') |
| 668 | |
| 669 | if (DEBUG) |
| 670 | this.stats.time('insertRight') |
| 671 | |
| 672 | this._split(index) |
| 673 | |
| 674 | const chunk = this.byEnd[index] |
| 675 | |
| 676 | if (chunk) { |
| 677 | chunk.prependLeft(content) |
| 678 | } |
| 679 | else { |
| 680 | this.intro = content + this.intro |
| 681 | } |
| 682 | |
| 683 | if (DEBUG) |
| 684 | this.stats.timeEnd('insertRight') |
| 685 | return this |
| 686 | } |
| 687 | |
| 688 | /** |
| 689 | * Same as `s.appendRight(...)`, except that the inserted content will go *before* any previous appends or prepends at `index` |