@contrail/util 1.0.17 → 1.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8,7 +8,7 @@ function mergeDeep(target, ...sources) {
|
|
|
8
8
|
const source = sources.shift();
|
|
9
9
|
if (isObject_1.isObject(target) && isObject_1.isObject(source)) {
|
|
10
10
|
for (const key in source) {
|
|
11
|
-
if (isObject_1.isObject(source[key])) {
|
|
11
|
+
if (isObject_1.isObject(source[key]) && !isDate(source[key])) {
|
|
12
12
|
if (!target[key])
|
|
13
13
|
Object.assign(target, { [key]: {} });
|
|
14
14
|
mergeDeep(target[key], source[key]);
|
|
@@ -21,3 +21,6 @@ function mergeDeep(target, ...sources) {
|
|
|
21
21
|
return mergeDeep(target, ...sources);
|
|
22
22
|
}
|
|
23
23
|
exports.mergeDeep = mergeDeep;
|
|
24
|
+
function isDate(object) {
|
|
25
|
+
return object != null && object instanceof Date;
|
|
26
|
+
}
|