This repository has been archived on 2025-07-07. You can view files and clone it, but cannot push or open issues or pull requests.
Files
eternos/frontend/style/node_modules/d3-array/src/intersection.js
2025-01-11 09:54:09 +03:00

20 lines
446 B
JavaScript

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);
}