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

Function compact

packages/effect/src/internal/hashMap.ts:1253–1261  ·  view source on GitHub ↗
(self: HashMap<K, Option.Option<A>>)

Source from the content-addressed store, hash-verified

1251
1252/** @internal */
1253export const compact = <K, A>(self: HashMap<K, Option.Option<A>>): HashMap<K, A> => {
1254 let result = empty<K, A>()
1255 for (const [key, value] of self) {
1256 if (Option.isSome(value)) {
1257 result = set(result, key, value.value)
1258 }
1259 }
1260 return result
1261}
1262
1263/** @internal */
1264export const filterMap = dual<

Callers

nothing calls this directly

Calls 2

emptyFunction · 0.70
setFunction · 0.50

Tested by

no test coverage detected