| 778 | return this; |
| 779 | } |
| 780 | trimStartAborted(charType) { |
| 781 | const rx = new RegExp('^' + (charType || '\\s') + '+'); |
| 782 | |
| 783 | this.intro = this.intro.replace(rx, ''); |
| 784 | if (this.intro.length) return true; |
| 785 | |
| 786 | let chunk = this.firstChunk; |
| 787 | |
| 788 | do { |
| 789 | const end = chunk.end; |
| 790 | const aborted = chunk.trimStart(rx); |
| 791 | |
| 792 | if (chunk.end !== end) { |
| 793 | // special case... |
| 794 | if (chunk === this.lastChunk) this.lastChunk = chunk.next; |
| 795 | |
| 796 | this.byEnd[chunk.end] = chunk; |
| 797 | this.byStart[chunk.next.start] = chunk.next; |
| 798 | this.byEnd[chunk.next.end] = chunk.next; |
| 799 | } |
| 800 | |
| 801 | if (aborted) return true; |
| 802 | chunk = chunk.next; |
| 803 | } while (chunk); |
| 804 | |
| 805 | return false; |
| 806 | } |
| 807 | |
| 808 | trimStart(charType) { |
| 809 | this.trimStartAborted(charType); |