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

Function union

packages/effect/src/internal/hashSet.ts:116–123  ·  view source on GitHub ↗
(self: HashSet<V0>, that: HashSet<V1>)

Source from the content-addressed store, hash-verified

114
115/** @internal */
116export const union = <V0, V1>(self: HashSet<V0>, that: HashSet<V1>): HashSet<V0 | V1> => {
117 const map = keyMap(self)
118 let result = map as HashMap.HashMap<V0 | V1, boolean>
119 for (const value of that) {
120 result = HashMap.set(result, value, true)
121 }
122 return makeImpl(result)
123}
124
125/** @internal */
126export const intersection = <V0, V1>(self: HashSet<V0>, that: HashSet<V1>): HashSet<V0 & V1> => {

Callers 1

hashMap.tsFile · 0.70

Calls 3

keyMapFunction · 0.85
makeImplFunction · 0.70
setMethod · 0.65

Tested by

no test coverage detected