Download node_modules/d3-array/src/intersection.js from NKessler/Horizon: direct link, hf CLI and curl.
- Browser
- Download file 446 Bytes
-
https://huggingface.co/NKessler/Horizon/resolve/main/node_modules/d3-array/src/intersection.js
- Command line
-
hf download hf://NKessler/Horizon/node_modules/d3-array/src/intersection.js
-
curl -L -o intersection.js https://huggingface.co/NKessler/Horizon/resolve/main/node_modules/d3-array/src/intersection.js
446 Bytes
| 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); | |
| } | |