| 449 | } |
| 450 | |
| 451 | prependLeft(index, content) { |
| 452 | index = index + this.offset; |
| 453 | |
| 454 | if (typeof content !== 'string') throw new TypeError('inserted content must be a string'); |
| 455 | |
| 456 | if (DEBUG) this.stats.time('insertRight'); |
| 457 | |
| 458 | this._split(index); |
| 459 | |
| 460 | const chunk = this.byEnd[index]; |
| 461 | |
| 462 | if (chunk) { |
| 463 | chunk.prependLeft(content); |
| 464 | } else { |
| 465 | this.intro = content + this.intro; |
| 466 | } |
| 467 | |
| 468 | if (DEBUG) this.stats.timeEnd('insertRight'); |
| 469 | return this; |
| 470 | } |
| 471 | |
| 472 | prependRight(index, content) { |
| 473 | index = index + this.offset; |