mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 10:27:49 +00:00
Cleanup _.xor patch and add a unit test.
This commit is contained in:
7
dist/lodash.compat.js
vendored
7
dist/lodash.compat.js
vendored
@@ -4484,12 +4484,13 @@
|
||||
function compact(array) {
|
||||
var index = -1,
|
||||
length = array ? array.length : 0,
|
||||
resIndex = 0,
|
||||
result = [];
|
||||
|
||||
while (++index < length) {
|
||||
var value = array[index];
|
||||
if (value) {
|
||||
result.push(value);
|
||||
result[resIndex++] = value;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@@ -5425,11 +5426,11 @@
|
||||
var array = arguments[index];
|
||||
if (isArray(array) || isArguments(array)) {
|
||||
var result = result
|
||||
? baseUniq(baseDifference(result, array).concat(baseDifference(array, result)))
|
||||
? baseDifference(result, array).concat(baseDifference(array, result))
|
||||
: array;
|
||||
}
|
||||
}
|
||||
return result || [];
|
||||
return result ? baseUniq(result) : [];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user