MCPcopy Index your code
hub / github.com/Effect-TS/effect / first

Function first

packages/effect/src/internal/redBlackTree.ts:216–224  ·  view source on GitHub ↗
(self: RBT.RedBlackTree<K, V>)

Source from the content-addressed store, hash-verified

214
215/** @internal */
216export const first = <K, V>(self: RBT.RedBlackTree<K, V>): Option.Option<[K, V]> => {
217 let node: Node.Node<K, V> | undefined = (self as RedBlackTreeImpl<K, V>)._root
218 let current: Node.Node<K, V> | undefined = (self as RedBlackTreeImpl<K, V>)._root
219 while (node !== undefined) {
220 current = node
221 node = node.left
222 }
223 return current ? Option.some([current.key, current.value]) : Option.none()
224}
225
226/** @internal */
227export const getAt = dual<

Callers 1

updateWithFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected