Browse Source

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

Kirk Lin 2 years ago
parent
commit
1f287145f4
1 changed files with 0 additions and 8 deletions
  1. 0 8
      src/utils/index.ts

+ 0 - 8
src/utils/index.ts

@@ -52,14 +52,6 @@ export function deepMerge<T extends object | null | undefined, U extends object
   target: U,
   mergeArrays: 'union' | 'intersection' | 'concat' | 'replace' = 'replace',
 ): T & U {
-
-  return mergeWith(cloneDeep(target), source, (objValue, srcValue) => {
-    if (isObject(objValue) && isObject(srcValue)) {
-      return mergeWith(cloneDeep(objValue), srcValue, (prevValue, nextValue) => {
-        // 如果是数组,合并数组(去重) If it is an array, merge the array (remove duplicates)
-        return isArray(prevValue) ? unionWith(prevValue, nextValue, isEqual) : undefined;
-      });
-
   if (!target) {
     return source as T & U;
   }