UNPKG

typedash

Version:

modern, type-safe collection of utility functions

15 lines (13 loc) 503 B
import { t as createTypeGuard } from "./createTypeGuard-DTvIg0I0.js"; import { t as negate } from "./negate-B3yzC5pg.js"; //#region src/functions/difference/difference.ts function difference(array1, array2, comparator) { if (!comparator) { const isArray2Item = createTypeGuard(array2); return array1.filter(negate(isArray2Item)); } return array1.filter((a1) => !array2.some((a2) => comparator(a1, a2))); } //#endregion export { difference as t }; //# sourceMappingURL=difference-C9MsBdr7.js.map