Files
lodash/_basePick.js
John-David Dalton d46bcaa98d Bump to v4.7.0.
2016-03-31 00:33:47 -07:00

24 lines
590 B
JavaScript

define(['./_arrayReduce'], function(arrayReduce) {
/**
* The base implementation of `_.pick` without support for individual
* property identifiers.
*
* @private
* @param {Object} object The source object.
* @param {string[]} props The property identifiers to pick.
* @returns {Object} Returns the new object.
*/
function basePick(object, props) {
object = Object(object);
return arrayReduce(props, function(result, key) {
if (key in object) {
result[key] = object[key];
}
return result;
}, {});
}
return basePick;
});