Files
cannaiq/frontend/node_modules/es-toolkit/dist/array/intersectionBy.mjs
2025-11-28 19:45:44 -07:00

7 lines
216 B
JavaScript

function intersectionBy(firstArr, secondArr, mapper) {
const mappedSecondSet = new Set(secondArr.map(mapper));
return firstArr.filter(item => mappedSecondSet.has(mapper(item)));
}
export { intersectionBy };