2025-09-05 22:40:22 +08:00

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);
}