1 var assignValue = require('./_assignValue'),
2 baseAssignValue = require('./_baseAssignValue');
5 * Copies properties of `source` to `object`.
8 * @param {Object} source The object to copy properties from.
9 * @param {Array} props The property identifiers to copy.
10 * @param {Object} [object={}] The object to copy properties to.
11 * @param {Function} [customizer] The function to customize copied values.
12 * @returns {Object} Returns `object`.
14 function copyObject(source, props, object, customizer) {
16 object || (object = {});
19 length = props.length;
21 while (++index < length) {
22 var key = props[index];
24 var newValue = customizer
25 ? customizer(object[key], source[key], key, object, source)
28 if (newValue === undefined) {
29 newValue = source[key];
32 baseAssignValue(object, key, newValue);
34 assignValue(object, key, newValue);
40 module.exports = copyObject;