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

Function fromIterable

packages/effect/src/MutableHashMap.ts:220–226  ·  view source on GitHub ↗
(entries: Iterable<readonly [K, V]>)

Source from the content-addressed store, hash-verified

218 * @since 2.0.0
219 */
220export const fromIterable = <K, V>(entries: Iterable<readonly [K, V]>): MutableHashMap<K, V> => {
221 const self = empty<K, V>()
222 for (const [key, value] of entries) {
223 set(self, key, value)
224 }
225 return self
226}
227
228/**
229 * Looks up a key in the `MutableHashMap` safely.

Callers 1

makeFunction · 0.70

Calls 2

emptyFunction · 0.70
setFunction · 0.50

Tested by

no test coverage detected