Use baseProperty instead of _.property in more places.

This commit is contained in:
jdalton
2015-02-01 20:05:56 -08:00
parent 1a58a70494
commit 67d9656e35

View File

@@ -6234,7 +6234,7 @@
* // => [36, 40] (iteration order is not guaranteed) * // => [36, 40] (iteration order is not guaranteed)
*/ */
function pluck(collection, key) { function pluck(collection, key) {
return map(collection, property(key)); return map(collection, baseProperty(key + ''));
} }
/** /**
@@ -10896,10 +10896,10 @@
// Add `LazyWrapper` methods for `_.pluck` and `_.where`. // Add `LazyWrapper` methods for `_.pluck` and `_.where`.
arrayEach(['pluck', 'where'], function(methodName, index) { arrayEach(['pluck', 'where'], function(methodName, index) {
var operationName = index ? 'filter' : 'map', var operationName = index ? 'filter' : 'map',
createCallback = index ? baseMatches : property; createCallback = index ? baseMatches : baseProperty;
LazyWrapper.prototype[methodName] = function(value) { LazyWrapper.prototype[methodName] = function(value) {
return this[operationName](createCallback(value)); return this[operationName](createCallback(index ? value : (value + '')));
}; };
}); });