MCPcopy Create free account
hub / github.com/Effect-TS/effect / next

Method next

packages/effect/src/internal/trie.ts:98–116  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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) {

Callers

nothing calls this directly

Calls 3

addToStackMethod · 0.95
filterMethod · 0.80
fMethod · 0.80

Tested by

no test coverage detected