UNPKG

@stackend/api

Version:

JS bindings to api.stackend.com

27 lines 677 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getAddedRemoved = void 0; /** * Given two sets, calculate additions and removals required to construct the new set. * @param oldSet * @param newSet */ function getAddedRemoved(oldSet, newSet) { var r = { added: new Set(), removed: new Set() }; oldSet.forEach(function (x) { if (!newSet.has(x)) { r.removed.add(x); } }); newSet.forEach(function (x) { if (!oldSet.has(x)) { r.added.add(x); } }); return r; } exports.getAddedRemoved = getAddedRemoved; //# sourceMappingURL=collections.js.map