Add deep functionality for _.omit and _.pick. (#2794)

This commit is contained in:
Aviv Rosental
2016-11-07 02:43:25 +02:00
committed by John-David Dalton
parent 6d951ccc87
commit 9ac729e1bc
2 changed files with 15 additions and 3 deletions

View File

@@ -3757,7 +3757,7 @@
function basePick(object, props) {
object = Object(object);
return basePickBy(object, props, function(value, key) {
return key in object;
return hasIn(object, key);
});
}
@@ -3777,10 +3777,10 @@
while (++index < length) {
var key = props[index],
value = object[key];
value = get(object, key);
if (predicate(value, key)) {
baseAssignValue(result, key, value);
set(result, key, value);
}
}
return result;