mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 10:07:48 +00:00
Bump to v4.14.0.
This commit is contained in:
11
_basePick.js
11
_basePick.js
@@ -1,4 +1,4 @@
|
||||
import arrayReduce from './_arrayReduce.js';
|
||||
import basePickBy from './_basePickBy.js';
|
||||
|
||||
/**
|
||||
* The base implementation of `_.pick` without support for individual
|
||||
@@ -11,12 +11,9 @@ import arrayReduce from './_arrayReduce.js';
|
||||
*/
|
||||
function basePick(object, props) {
|
||||
object = Object(object);
|
||||
return arrayReduce(props, function(result, key) {
|
||||
if (key in object) {
|
||||
result[key] = object[key];
|
||||
}
|
||||
return result;
|
||||
}, {});
|
||||
return basePickBy(object, props, function(value, key) {
|
||||
return key in object;
|
||||
});
|
||||
}
|
||||
|
||||
export default basePick;
|
||||
|
||||
Reference in New Issue
Block a user