Last change
on this file since 571e0df was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
582 bytes
|
Line | |
---|
1 | var baseAssignValue = require('./_baseAssignValue'),
|
---|
2 | eq = require('./eq');
|
---|
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 | module.exports = assignMergeValue;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.