Commit 1f287145f477e609b80b5a59b7787d5cd1a66213

Authored by Kirk Lin
Committed by GitHub
1 parent 9c43c741

fix(deepMerge): 去掉合并错误的代码 (#2848)

Showing 1 changed file with 0 additions and 8 deletions
src/utils/index.ts
@@ -52,14 +52,6 @@ export function deepMerge<T extends object | null | undefined, U extends object @@ -52,14 +52,6 @@ export function deepMerge<T extends object | null | undefined, U extends object
52 target: U, 52 target: U,
53 mergeArrays: 'union' | 'intersection' | 'concat' | 'replace' = 'replace', 53 mergeArrays: 'union' | 'intersection' | 'concat' | 'replace' = 'replace',
54 ): T & U { 54 ): T & U {
55 -  
56 - return mergeWith(cloneDeep(target), source, (objValue, srcValue) => {  
57 - if (isObject(objValue) && isObject(srcValue)) {  
58 - return mergeWith(cloneDeep(objValue), srcValue, (prevValue, nextValue) => {  
59 - // 如果是数组,合并数组(去重) If it is an array, merge the array (remove duplicates)  
60 - return isArray(prevValue) ? unionWith(prevValue, nextValue, isEqual) : undefined;  
61 - });  
62 -  
63 if (!target) { 55 if (!target) {
64 return source as T & U; 56 return source as T & U;
65 } 57 }