()
| 590 | } |
| 591 | |
| 592 | iterator(): Iterator<[K, V]> { |
| 593 | let childIndex = 0 |
| 594 | let currentIterator: Iterator<[K, V]> | undefined |
| 595 | |
| 596 | return { |
| 597 | next: () => { |
| 598 | while (childIndex < this.children.length) { |
| 599 | if (!currentIterator) { |
| 600 | currentIterator = this.children[childIndex].iterator() |
| 601 | } |
| 602 | |
| 603 | const result = currentIterator.next() |
| 604 | if (!result.done) { |
| 605 | return result |
| 606 | } |
| 607 | |
| 608 | currentIterator = undefined |
| 609 | childIndex++ |
| 610 | } |
| 611 | |
| 612 | return { done: true, value: undefined } |
| 613 | } |
| 614 | } |
| 615 | } |
| 616 | |
| 617 | [Symbol.iterator](): Iterator<[K, V]> { |
| 618 | return this.iterator() |
no test coverage detected