()
| 96 | } |
| 97 | |
| 98 | next(): IteratorResult<T> { |
| 99 | while (this.stack.length > 0) { |
| 100 | const [node, keyString, isAdded] = this.stack.pop()! |
| 101 | |
| 102 | if (isAdded) { |
| 103 | const value = node.value |
| 104 | if (value !== undefined) { |
| 105 | const key = keyString + node.key |
| 106 | if (this.filter(key, value.value)) { |
| 107 | return { done: false, value: this.f(key, value.value) } |
| 108 | } |
| 109 | } |
| 110 | } else { |
| 111 | this.addToStack(node, keyString) |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | return { done: true, value: undefined } |
| 116 | } |
| 117 | |
| 118 | addToStack(node: Node<V>, keyString: string) { |
| 119 | if (node.right !== undefined) { |
nothing calls this directly
no test coverage detected