Skip to content

Commit

Permalink
Merge pull request #200 from VisActor/fix/merge-error
Browse files Browse the repository at this point in the history
Fix/merge error
  • Loading branch information
xile611 authored Aug 20, 2024
2 parents 993e36a + 11ed0da commit cc8452b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@visactor/vutils",
"comment": "fix: merge error for invalid value",
"type": "none"
}
],
"packageName": "@visactor/vutils"
}
2 changes: 1 addition & 1 deletion packages/vutils/src/common/merge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function baseMergeDeep(
// }
// 不考虑 argument 类型
else if (isPlainObject(srcValue)) {
newValue = objValue;
newValue = objValue ?? {};
// 不考虑 prototype 的额外处理
if (typeof objValue === 'function' || typeof objValue !== 'object') {
newValue = {};
Expand Down

0 comments on commit cc8452b

Please sign in to comment.