| 759 | return this; |
| 760 | } |
| 761 | trimStartAborted(charType) { |
| 762 | const rx = new RegExp('^' + (charType || '\\s') + '+'); |
| 763 | this.intro = this.intro.replace(rx, ''); |
| 764 | if (this.intro.length) return true; |
| 765 | let chunk = this.firstChunk; |
| 766 | do { |
| 767 | const end = chunk.end; |
| 768 | const aborted = chunk.trimStart(rx); |
| 769 | if (chunk.end !== end) { |
| 770 | if (chunk === this.lastChunk) this.lastChunk = chunk.next; |
| 771 | this.byEnd[chunk.end] = chunk; |
| 772 | this.byStart[chunk.next.start] = chunk.next; |
| 773 | this.byEnd[chunk.next.end] = chunk.next; |
| 774 | } |
| 775 | if (aborted) return true; |
| 776 | chunk = chunk.next; |
| 777 | } while (chunk); |
| 778 | return false; |
| 779 | } |
| 780 | trimStart(charType) { |
| 781 | this.trimStartAborted(charType); |
| 782 | return this; |