aboutsummaryrefslogtreecommitdiff
path: root/node_modules/lodash/_assignMergeValue.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/lodash/_assignMergeValue.js')
-rw-r--r--node_modules/lodash/_assignMergeValue.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/node_modules/lodash/_assignMergeValue.js b/node_modules/lodash/_assignMergeValue.js
new file mode 100644
index 0000000..cb1185e
--- /dev/null
+++ b/node_modules/lodash/_assignMergeValue.js
@@ -0,0 +1,20 @@
+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;