mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-12 11:57:49 +00:00
Update underscore unit tests.
Former-commit-id: ae00a864c7cb3bff9970289917df681ad5e295d9
This commit is contained in:
13
vendor/underscore/underscore.js
vendored
13
vendor/underscore/underscore.js
vendored
@@ -416,13 +416,13 @@
|
||||
_.uniq = _.unique = function(array, isSorted, iterator) {
|
||||
var initial = iterator ? _.map(array, iterator) : array;
|
||||
var results = [];
|
||||
_.reduce(initial, function(memo, value, index) {
|
||||
if (isSorted ? (_.last(memo) !== value || !memo.length) : !_.include(memo, value)) {
|
||||
memo.push(value);
|
||||
var seen = [];
|
||||
each(initial, function(value, index) {
|
||||
if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.include(seen, value)) {
|
||||
seen.push(value);
|
||||
results.push(array[index]);
|
||||
}
|
||||
return memo;
|
||||
}, []);
|
||||
});
|
||||
return results;
|
||||
};
|
||||
|
||||
@@ -830,8 +830,7 @@
|
||||
if (result) {
|
||||
// Deep compare the contents, ignoring non-numeric properties.
|
||||
while (size--) {
|
||||
// Ensure commutative equality for sparse arrays.
|
||||
if (!(result = size in a == size in b && eq(a[size], b[size], aStack, bStack))) break;
|
||||
if (!(result = eq(a[size], b[size], aStack, bStack))) break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user