1 var eq = require('./eq');
3 /** Used for built-in method references. */
4 var objectProto = Object.prototype;
6 /** Used to check objects for own properties. */
7 var hasOwnProperty = objectProto.hasOwnProperty;
10 * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
11 * of source objects to the destination object for all destination properties
12 * that resolve to `undefined`.
15 * @param {*} objValue The destination value.
16 * @param {*} srcValue The source value.
17 * @param {string} key The key of the property to assign.
18 * @param {Object} object The parent object of `objValue`.
19 * @returns {*} Returns the value to assign.
21 function customDefaultsAssignIn(objValue, srcValue, key, object) {
22 if (objValue === undefined ||
23 (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
29 module.exports = customDefaultsAssignIn;