lbry-desktop/ui/util/set-operations.js
2019-11-11 13:27:29 -05:00

15 lines
306 B
JavaScript

export const setDifference = (setA, setB) => {
let _difference = new Set(setA);
for (let el of setB) {
_difference.delete(el);
}
return _difference;
};
export const setUnion = (setA, setB) => {
let _union = new Set(setA);
for (let el of setB) {
_union.add(el);
}
return _union;
};