Security update for permissions_by_term
[yaffs-website] / node_modules / uncss / node_modules / lodash / xorWith.js
1 var arrayFilter = require('./internal/arrayFilter'),
2     baseXor = require('./internal/baseXor'),
3     isArrayLikeObject = require('./isArrayLikeObject'),
4     last = require('./last'),
5     rest = require('./rest');
6
7 /**
8  * This method is like `_.xor` except that it accepts `comparator` which is
9  * invoked to compare elements of `arrays`. The comparator is invoked with
10  * two arguments: (arrVal, othVal).
11  *
12  * @static
13  * @memberOf _
14  * @category Array
15  * @param {...Array} [arrays] The arrays to inspect.
16  * @param {Function} [comparator] The comparator invoked per element.
17  * @returns {Array} Returns the new array of values.
18  * @example
19  *
20  * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
21  * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
22  *
23  * _.xorWith(objects, others, _.isEqual);
24  * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
25  */
26 var xorWith = rest(function(arrays) {
27   var comparator = last(arrays);
28   if (isArrayLikeObject(comparator)) {
29     comparator = undefined;
30   }
31   return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
32 });
33
34 module.exports = xorWith;