()
| 766 | } |
| 767 | |
| 768 | iterator(): Iterator<[K, V]> { |
| 769 | let childIndex = 0 |
| 770 | let currentIterator: Iterator<[K, V]> | undefined |
| 771 | |
| 772 | return { |
| 773 | next: () => { |
| 774 | while (childIndex < this.children.length) { |
| 775 | const child = this.children[childIndex] |
| 776 | if (!child) { |
| 777 | childIndex++ |
| 778 | continue |
| 779 | } |
| 780 | |
| 781 | if (!currentIterator) { |
| 782 | currentIterator = child.iterator() |
| 783 | } |
| 784 | |
| 785 | const result = currentIterator.next() |
| 786 | if (!result.done) { |
| 787 | return result |
| 788 | } |
| 789 | |
| 790 | currentIterator = undefined |
| 791 | childIndex++ |
| 792 | } |
| 793 | |
| 794 | return { done: true, value: undefined } |
| 795 | } |
| 796 | } |
| 797 | } |
| 798 | |
| 799 | [Symbol.iterator](): Iterator<[K, V]> { |
| 800 | return this.iterator() |
no test coverage detected