mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 03:17:49 +00:00
Bump to v4.14.0.
This commit is contained in:
8
xorBy.js
8
xorBy.js
@@ -1,9 +1,9 @@
|
||||
import arrayFilter from './_arrayFilter.js';
|
||||
import baseIteratee from './_baseIteratee.js';
|
||||
import baseRest from './_baseRest.js';
|
||||
import baseXor from './_baseXor.js';
|
||||
import isArrayLikeObject from './isArrayLikeObject.js';
|
||||
import last from './last.js';
|
||||
import rest from './rest.js';
|
||||
|
||||
/**
|
||||
* This method is like `_.xor` except that it accepts `iteratee` which is
|
||||
@@ -16,7 +16,7 @@ import rest from './rest.js';
|
||||
* @since 4.0.0
|
||||
* @category Array
|
||||
* @param {...Array} [arrays] The arrays to inspect.
|
||||
* @param {Array|Function|Object|string} [iteratee=_.identity]
|
||||
* @param {Function} [iteratee=_.identity]
|
||||
* The iteratee invoked per element.
|
||||
* @returns {Array} Returns the new array of filtered values.
|
||||
* @example
|
||||
@@ -28,12 +28,12 @@ import rest from './rest.js';
|
||||
* _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
|
||||
* // => [{ 'x': 2 }]
|
||||
*/
|
||||
var xorBy = rest(function(arrays) {
|
||||
var xorBy = baseRest(function(arrays) {
|
||||
var iteratee = last(arrays);
|
||||
if (isArrayLikeObject(iteratee)) {
|
||||
iteratee = undefined;
|
||||
}
|
||||
return baseXor(arrayFilter(arrays, isArrayLikeObject), baseIteratee(iteratee));
|
||||
return baseXor(arrayFilter(arrays, isArrayLikeObject), baseIteratee(iteratee, 2));
|
||||
});
|
||||
|
||||
export default xorBy;
|
||||
|
||||
Reference in New Issue
Block a user