pixi.js
Version:
PixiJS — The HTML5 Creation Engine =============
25 lines (23 loc) • 858 B
JavaScript
;
function removeStructAndGroupDuplicates(vertexStructsAndGroups, fragmentStructsAndGroups) {
const structNameSet = /* @__PURE__ */ new Set();
const dupeGroupKeySet = /* @__PURE__ */ new Set();
const structs = [...vertexStructsAndGroups.structs, ...fragmentStructsAndGroups.structs].filter((struct) => {
if (structNameSet.has(struct.name)) {
return false;
}
structNameSet.add(struct.name);
return true;
});
const groups = [...vertexStructsAndGroups.groups, ...fragmentStructsAndGroups.groups].filter((group) => {
const key = `${group.name}-${group.binding}`;
if (dupeGroupKeySet.has(key)) {
return false;
}
dupeGroupKeySet.add(key);
return true;
});
return { structs, groups };
}
export { removeStructAndGroupDuplicates };
//# sourceMappingURL=removeStructAndGroupDuplicates.mjs.map