2016-11-16 01:59:39 +01:00
|
|
|
var basePickBy = require('./_basePickBy'),
|
|
|
|
hasIn = require('./hasIn');
|
2016-10-10 03:43:44 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The base implementation of `_.pick` without support for individual
|
|
|
|
* property identifiers.
|
|
|
|
*
|
|
|
|
* @private
|
|
|
|
* @param {Object} object The source object.
|
2016-11-16 01:59:39 +01:00
|
|
|
* @param {string[]} paths The property paths to pick.
|
2016-10-10 03:43:44 +02:00
|
|
|
* @returns {Object} Returns the new object.
|
|
|
|
*/
|
2016-11-16 01:59:39 +01:00
|
|
|
function basePick(object, paths) {
|
2016-10-10 03:43:44 +02:00
|
|
|
object = Object(object);
|
2016-11-16 01:59:39 +01:00
|
|
|
return basePickBy(object, paths, function(value, path) {
|
|
|
|
return hasIn(object, path);
|
2016-10-10 03:43:44 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = basePick;
|