Преглед на файлове

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

Kirk Lin преди 2 години
родител
ревизия
1f287145f4
променени са 1 файла, в които са добавени 0 реда и са изтрити 8 реда
  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;
   }