assignDefaults.js 428 B

12345678910111213
  1. /**
  2. * Used by `_.defaults` to customize its `_.assign` use.
  3. *
  4. * @private
  5. * @param {*} objectValue The destination object property value.
  6. * @param {*} sourceValue The source object property value.
  7. * @returns {*} Returns the value to assign to the destination object.
  8. */
  9. function assignDefaults(objectValue, sourceValue) {
  10. return objectValue === undefined ? sourceValue : objectValue;
  11. }
  12. module.exports = assignDefaults;