Cleanup lazy _.pluck and _.where.

This commit is contained in:
John-David Dalton
2014-11-14 19:36:52 -08:00
parent fc6c084693
commit db97ae46e5
2 changed files with 24 additions and 23 deletions

View File

@@ -10190,13 +10190,13 @@
};
});
// add `LazyWrapper` methods for `_.pluck` and `_.where`
// Add `LazyWrapper` methods for `_.pluck` and `_.where`.
arrayEach(['pluck', 'where'], function (methodName, index) {
var operationName = index ? 'filter' : 'map',
getCallback = index ? matches : property;
LazyWrapper.prototype[methodName] = function (arg) {
return this[operationName](getCallback(arg));
LazyWrapper.prototype[methodName] = function(value) {
return this[operationName](getCallback(value));
};
});