mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-14 20:17:03 +00:00
fix(profile): close km legacy kimi compatibility gaps
This commit is contained in:
1 parent
cf8070b5f0
commit
0bf00b23d9
9 files changed
+343
-66
No files matched your search
@@ -176,6 +176,10 @@ export const PROVIDER_PRESETS: ProviderPreset[] = [
|
||||
},
|
||||
];
|
||||
|
||||
const LEGACY_PRESET_ALIASES: Readonly<Record<string, string>> = Object.freeze({
|
||||
kimi: 'km',
|
||||
});
|
||||
|
||||
/** Get presets by category */
|
||||
export function getPresetsByCategory(category: PresetCategory): ProviderPreset[] {
|
||||
return PROVIDER_PRESETS.filter((p) => p.category === category);
|
||||
@@ -183,7 +187,9 @@ export function getPresetsByCategory(category: PresetCategory): ProviderPreset[]
|
||||
|
||||
/** Get preset by ID */
|
||||
export function getPresetById(id: string): ProviderPreset | undefined {
|
||||
return PROVIDER_PRESETS.find((p) => p.id.toLowerCase() === id.toLowerCase());
|
||||
const normalized = id.trim().toLowerCase();
|
||||
const canonical = LEGACY_PRESET_ALIASES[normalized] || normalized;
|
||||
return PROVIDER_PRESETS.find((p) => p.id.toLowerCase() === canonical);
|
||||
}
|
||||
|
||||
/** Check if a URL matches a known preset */
|
||||
|
||||
Reference in new issue
Block a user