UNPKG

@splitsoftware/splitio-commons

Version:
18 lines (17 loc) 487 B
export function setToArray(set) { if (Array.from) return Array.from(set); var array = []; set.forEach(function (value) { array.push(value); }); return array; } export function returnSetsUnion(set, set2) { return new Set(setToArray(set).concat(setToArray(set2))); } export function returnDifference(list1, list2) { list1 = list1 || []; list2 = list2 || []; return list1.filter(function (item) { return list2.indexOf(item) === -1; }); }