mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 10:17:48 +00:00
Bump to v4.11.2.
This commit is contained in:
4
pick.js
4
pick.js
@@ -1,6 +1,8 @@
|
||||
import arrayMap from './_arrayMap';
|
||||
import baseFlatten from './_baseFlatten';
|
||||
import basePick from './_basePick';
|
||||
import rest from './rest';
|
||||
import toKey from './_toKey';
|
||||
|
||||
/**
|
||||
* Creates an object composed of the picked `object` properties.
|
||||
@@ -20,7 +22,7 @@ import rest from './rest';
|
||||
* // => { 'a': 1, 'c': 3 }
|
||||
*/
|
||||
var pick = rest(function(object, props) {
|
||||
return object == null ? {} : basePick(object, baseFlatten(props, 1));
|
||||
return object == null ? {} : basePick(object, arrayMap(baseFlatten(props, 1), toKey));
|
||||
});
|
||||
|
||||
export default pick;
|
||||
|
||||
Reference in New Issue
Block a user