qlin b7308f445e
feat: 升级vite8 (#276)
Co-authored-by: qlin <qlin@webank.com>
2026-04-28 20:45:13 +08:00

15 lines
451 B
TypeScript

import { deepmerge } from '@fesjs/utils';
import { isPlainObject } from 'es-toolkit/compat';
interface MergeDefaultOptions {
defaultConfig: any;
config: any;
}
export default function mergeDefault({ defaultConfig, config }: MergeDefaultOptions): any {
if (isPlainObject(defaultConfig) && isPlainObject(config)) {
return deepmerge(defaultConfig, config);
}
return typeof config !== 'undefined' ? config : defaultConfig;
}