mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-29 09:37:37 +08:00
chore: remove dead code from providerConfigUtils and config API
- Remove unused functions: updateCommonConfigSnippet, replaceCommonConfigSnippet, replaceGeminiCommonConfigSnippet, updateTomlCommonConfigSnippet, replaceTomlCommonConfigSnippet and their internal helpers (~600 lines) - Remove deprecated getClaudeCommonConfigSnippet and setClaudeCommonConfigSnippet - Remove unused imports (deepClone, deepMerge)
This commit is contained in:
@@ -66,27 +66,6 @@ const pendingSyncParams: Record<
|
||||
|
||||
const SYNC_DEBOUNCE_MS = 500;
|
||||
|
||||
/**
|
||||
* 获取 Claude 通用配置片段(已废弃,使用 getCommonConfigSnippet)
|
||||
* @returns 通用配置片段(JSON 字符串),如果不存在则返回 null
|
||||
* @deprecated 使用 getCommonConfigSnippet('claude') 替代
|
||||
*/
|
||||
export async function getClaudeCommonConfigSnippet(): Promise<string | null> {
|
||||
return invoke<string | null>("get_claude_common_config_snippet");
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置 Claude 通用配置片段(已废弃,使用 setCommonConfigSnippet)
|
||||
* @param snippet - 通用配置片段(JSON 字符串)
|
||||
* @throws 如果 JSON 格式无效
|
||||
* @deprecated 使用 setCommonConfigSnippet('claude', snippet) 替代
|
||||
*/
|
||||
export async function setClaudeCommonConfigSnippet(
|
||||
snippet: string,
|
||||
): Promise<void> {
|
||||
return invoke("set_claude_common_config_snippet", { snippet });
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取通用配置片段(统一接口)
|
||||
* @param appType - 应用类型(claude/codex/gemini)
|
||||
@@ -453,7 +432,6 @@ function getSettingsConfigString(
|
||||
|
||||
case "gemini":
|
||||
// Gemini: settingsConfig 是包含 env 字段的 JSON 对象
|
||||
// replaceGeminiCommonConfigSnippet 期望接收完整的 settingsConfig JSON
|
||||
return typeof config === "string" ? config : JSON.stringify(config);
|
||||
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user