mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 01:17:50 +00:00
Bump to v4.7.0.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
define(['./_baseForIn'], function(baseForIn) {
|
||||
define(['./_getAllKeysIn'], function(getAllKeysIn) {
|
||||
|
||||
/**
|
||||
* The base implementation of `_.pickBy` without support for iteratee shorthands.
|
||||
@@ -9,12 +9,19 @@ define(['./_baseForIn'], function(baseForIn) {
|
||||
* @returns {Object} Returns the new object.
|
||||
*/
|
||||
function basePickBy(object, predicate) {
|
||||
var result = {};
|
||||
baseForIn(object, function(value, key) {
|
||||
var index = -1,
|
||||
props = getAllKeysIn(object),
|
||||
length = props.length,
|
||||
result = {};
|
||||
|
||||
while (++index < length) {
|
||||
var key = props[index],
|
||||
value = object[key];
|
||||
|
||||
if (predicate(value, key)) {
|
||||
result[key] = value;
|
||||
}
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user