UNPKG

@splitsoftware/splitio-commons

Version:
18 lines (17 loc) 517 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(list, list2) { if (list === void 0) { list = []; } if (list2 === void 0) { list2 = []; } return list.filter(function (item) { return list2.indexOf(item) === -1; }); }