main
Last change
on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
580 bytes
|
Line | |
---|
1 | import baseAssignValue from './_baseAssignValue.js';
|
---|
2 | import eq from './eq.js';
|
---|
3 |
|
---|
4 | /**
|
---|
5 | * This function is like `assignValue` except that it doesn't assign
|
---|
6 | * `undefined` values.
|
---|
7 | *
|
---|
8 | * @private
|
---|
9 | * @param {Object} object The object to modify.
|
---|
10 | * @param {string} key The key of the property to assign.
|
---|
11 | * @param {*} value The value to assign.
|
---|
12 | */
|
---|
13 | function assignMergeValue(object, key, value) {
|
---|
14 | if ((value !== undefined && !eq(object[key], value)) ||
|
---|
15 | (value === undefined && !(key in object))) {
|
---|
16 | baseAssignValue(object, key, value);
|
---|
17 | }
|
---|
18 | }
|
---|
19 |
|
---|
20 | export default assignMergeValue;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.