Skip to content

Commit

Permalink
fix: 修复合并config时数组重复问题
Browse files Browse the repository at this point in the history
  • Loading branch information
wangweianger committed May 23, 2023
1 parent 57541e9 commit 1a8f38b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/yunfly-core/src/util.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as path from 'path';
import logger from '@yunflyjs/loggers';

import { AnyOptionConfig, Config } from './type';

const _ = require('lodash');
const fs = require('fs');
const deepmerge = require('deepmerge');

Expand Down Expand Up @@ -40,7 +40,7 @@ export const deepMerge = (obj1: AnyOptionConfig, obj2: AnyOptionConfig): any =>
const sourceArray_ = sourceArray.map((item) =>
(typeof item === 'string' ? item.replace(/\\/g, '/') : item),
);
return [...new Set([...destinationArray_, ...sourceArray_])];
return _.uniqWith([...destinationArray_, ...sourceArray_], _.isEqual);
};
return deepmerge(obj1, obj2, { arrayMerge: overwriteMerge });
};
Expand Down

0 comments on commit 1a8f38b

Please sign in to comment.