@whitesev/utils 1.5.9 → 1.6.0

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.
@@ -3464,13 +3464,20 @@ var Utils = (function () {
3464
3464
  return source;
3465
3465
  }
3466
3466
  }
3467
+ if (source == null) {
3468
+ return target;
3469
+ }
3470
+ if (target == null) {
3471
+ target = {};
3472
+ }
3467
3473
  if (isAdd) {
3468
3474
  for (const sourceKeyName in source) {
3469
3475
  const targetKeyName = sourceKeyName;
3470
3476
  let targetValue = target[targetKeyName];
3471
3477
  let sourceValue = source[sourceKeyName];
3472
- if (sourceKeyName in target &&
3473
- typeof sourceValue === "object" &&
3478
+ if (typeof sourceValue === "object" &&
3479
+ sourceValue != null &&
3480
+ sourceKeyName in target &&
3474
3481
  !UtilsContext.isDOM(sourceValue)) {
3475
3482
  /* 源端的值是object类型,且不是元素节点 */
3476
3483
  target[sourceKeyName] = UtilsContext.assign(targetValue, sourceValue, isAdd);
@@ -3485,6 +3492,7 @@ var Utils = (function () {
3485
3492
  let targetValue = target[targetKeyName];
3486
3493
  let sourceValue = source[targetKeyName];
3487
3494
  if (typeof sourceValue === "object" &&
3495
+ sourceValue != null &&
3488
3496
  !UtilsContext.isDOM(sourceValue) &&
3489
3497
  Object.keys(sourceValue).length) {
3490
3498
  /* 源端的值是object类型,且不是元素节点 */