mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2025-10-13 18:22:13 +08:00
29 lines
591 B
TypeScript
29 lines
591 B
TypeScript
import type { UserConfig } from '../../types';
|
|
import { lodash } from '@fesjs/utils';
|
|
|
|
interface UpdateUserConfigWithKeyOptions {
|
|
key: string;
|
|
value: any;
|
|
userConfig: UserConfig;
|
|
}
|
|
|
|
interface GetUserConfigWithKeyOptions {
|
|
key: string;
|
|
userConfig: UserConfig;
|
|
}
|
|
|
|
export function updateUserConfigWithKey({
|
|
key,
|
|
value,
|
|
userConfig,
|
|
}: UpdateUserConfigWithKeyOptions): void {
|
|
lodash.set(userConfig, key, value);
|
|
}
|
|
|
|
export function getUserConfigWithKey({
|
|
key,
|
|
userConfig,
|
|
}: GetUserConfigWithKeyOptions): any {
|
|
return lodash.get(userConfig, key);
|
|
}
|