mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 08:07:50 +00:00
Coerce value to a string once in _.intersection and _.uniq.
Former-commit-id: 5cb0f0034c473ec62c3b342f45d22c0abe6c5fb3
This commit is contained in:
14
lodash.js
14
lodash.js
@@ -2918,9 +2918,10 @@
|
||||
while (++index < length) {
|
||||
var value = array[index];
|
||||
if (isLarge) {
|
||||
var inited = hasOwnProperty.call(cache[0], value + '')
|
||||
? !(seen = cache[0][value])
|
||||
: (seen = cache[0][value] = []);
|
||||
var key = value + '';
|
||||
var inited = hasOwnProperty.call(cache[0], key)
|
||||
? !(seen = cache[0][key])
|
||||
: (seen = cache[0][key] = []);
|
||||
}
|
||||
if (inited || indexOf(seen, value) < 0) {
|
||||
if (isLarge) {
|
||||
@@ -3233,9 +3234,10 @@
|
||||
computed = callback ? callback(value, index, array) : value;
|
||||
|
||||
if (isLarge) {
|
||||
var inited = hasOwnProperty.call(cache, computed + '')
|
||||
? !(seen = cache[computed])
|
||||
: (seen = cache[computed] = []);
|
||||
var key = computed + '';
|
||||
var inited = hasOwnProperty.call(cache, key)
|
||||
? !(seen = cache[key])
|
||||
: (seen = cache[key] = []);
|
||||
}
|
||||
if (isSorted
|
||||
? !index || seen[seen.length - 1] !== computed
|
||||
|
||||
Reference in New Issue
Block a user