UNPKG

typedash

Version:

modern, type-safe collection of utility functions

14 lines (12 loc) 452 B
import { t as createTypeGuard } from "./createTypeGuard-DTvIg0I0.js"; //#region src/functions/intersection/intersection.ts function intersection(array1, array2, comparator) { if (!comparator) { const isArray2Item = createTypeGuard(array2); return array1.filter(isArray2Item); } return array1.filter((a1) => array2.some((a2) => comparator(a1, a2))); } //#endregion export { intersection as t }; //# sourceMappingURL=intersection-DotSjEHp.js.map