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

Function keys

packages/effect/src/internal/hashMap.ts:1014–1028  ·  view source on GitHub ↗
(self: HashMap<K, V>)

Source from the content-addressed store, hash-verified

1012
1013/** @internal */
1014export const keys = <K, V>(self: HashMap<K, V>): IterableIterator<K> => {
1015 const iterator = self[Symbol.iterator]()
1016 return {
1017 [Symbol.iterator]() {
1018 return this
1019 },
1020 next() {
1021 const result = iterator.next()
1022 if (result.done) {
1023 return { done: true, value: undefined }
1024 }
1025 return { done: false, value: result.value[0] }
1026 }
1027 }
1028}
1029
1030/** @internal */
1031export const values = <K, V>(self: HashMap<K, V>): IterableIterator<V> => {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected