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.
13 * @param {*} objValue The destination value.
14 * @param {*} srcValue The source value.
15 * @param {string} key The key of the property to assign.
16 * @param {Object} object The parent object of `objValue`.
17 * @returns {*} Returns the value to assign.
19 function assignInDefaults(objValue, srcValue, key, object) {
20 if (objValue === undefined ||
21 (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
27 module.exports = assignInDefaults;