DieselDepot-APP/node_modules/es-toolkit/dist/fp/array/xorWith.js
SJCoetz def597c157 chore: add generated build artifacts and node module type files
add all Next.js build outputs and third-party dependency type declaration files
2026-07-20 01:18:42 +02:00

26 lines
950 B
JavaScript

const require_xorWith = require("../../array/xorWith.js");
//#region src/fp/array/xorWith.ts
/**
* Creates a function that returns the symmetric difference using a custom equality function.
*
* The equality function decides whether two values represent the same item, matching the
* main {@link xorWith} behavior.
*
* @template T - The type of elements in the arrays.
* @param secondArray - Values to compare with the piped array.
* @param areItemsEqual - Returns true when two values are equal.
* @returns A function that maps a readonly array to its symmetric difference.
*
* @example
* import { pipe, xorWith } from 'es-toolkit/fp';
*
* pipe([{ id: 1 }, { id: 2 }], xorWith([{ id: 2 }, { id: 3 }], (a, b) => a.id === b.id));
* // => [{ id: 1 }, { id: 3 }]
*/
function xorWith(secondArray, areItemsEqual) {
return function(array) {
return require_xorWith.xorWith(array, secondArray, areItemsEqual);
};
}
//#endregion
exports.xorWith = xorWith;