You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
580 B
21 lines
580 B
2 weeks ago
|
import baseAssignValue from './_baseAssignValue.js';
|
||
|
import eq from './eq.js';
|
||
|
|
||
|
/**
|
||
|
* 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);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export default assignMergeValue;
|