improved viewers

This commit is contained in:
Andrea Pozzetti
2025-11-16 13:39:43 +01:00
parent c19e5829d7
commit 1678566c11
5324 changed files with 606218 additions and 29 deletions
+19
View File
@@ -0,0 +1,19 @@
import {InternSet} from "internmap";
export default function intersection(values, ...others) {
values = new InternSet(values);
others = others.map(set);
out: for (const value of values) {
for (const other of others) {
if (!other.has(value)) {
values.delete(value);
continue out;
}
}
}
return values;
}
function set(values) {
return values instanceof InternSet ? values : new InternSet(values);
}