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