mirror of
https://github.com/WeBankFinTech/fes.js.git
synced 2026-04-29 15:04:03 +08:00
29 lines
584 B
TypeScript
29 lines
584 B
TypeScript
import type { UserConfig } from '../../types';
|
|
import { set, get } from 'es-toolkit/compat';
|
|
|
|
interface UpdateUserConfigWithKeyOptions {
|
|
key: string;
|
|
value: any;
|
|
userConfig: UserConfig;
|
|
}
|
|
|
|
interface GetUserConfigWithKeyOptions {
|
|
key: string;
|
|
userConfig: UserConfig;
|
|
}
|
|
|
|
export function updateUserConfigWithKey({
|
|
key,
|
|
value,
|
|
userConfig,
|
|
}: UpdateUserConfigWithKeyOptions): void {
|
|
set(userConfig, key, value);
|
|
}
|
|
|
|
export function getUserConfigWithKey({
|
|
key,
|
|
userConfig,
|
|
}: GetUserConfigWithKeyOptions): any {
|
|
return get(userConfig, key);
|
|
}
|