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

Function compact

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

emptyFunction · 0.70
setFunction · 0.70

Tested by

no test coverage detected