1
0
mirror of https://github.com/thangisme/notes.git synced 2024-11-09 16:37:20 -05:00
notes/node_modules/lodash/_assignMergeValue.js

21 lines
582 B
JavaScript
Raw Normal View History

2017-03-09 13:16:08 -05:00
var baseAssignValue = require('./_baseAssignValue'),
eq = require('./eq');
/**
* This function is like `assignValue` except that it doesn't assign
* `undefined` values.
*
* @private
* @param {Object} object The object to modify.
* @param {string} key The key of the property to assign.
* @param {*} value The value to assign.
*/
function assignMergeValue(object, key, value) {
if ((value !== undefined && !eq(object[key], value)) ||
(value === undefined && !(key in object))) {
baseAssignValue(object, key, value);
}
}
module.exports = assignMergeValue;