Skip to content

Commit 57444de

Browse files
committed
Preserve provider narrowing when validating config names
1 parent ca40c28 commit 57444de

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

‎src/commands/settings.ts‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,7 @@ function normalizeProviderName(input: string): BuiltInProviderName | null {
270270
if (normalized === 'vertex') {
271271
return 'vertexai';
272272
}
273-
if (CONFIG_PROVIDER_NAMES.includes(normalized as BuiltInProviderName)) {
274-
return normalized as BuiltInProviderName;
275-
}
276-
return null;
273+
return CONFIG_PROVIDER_NAMES.find(provider => provider === normalized) ?? null;
277274
}
278275

279276
function normalizeProviderConfigKey(input: string): { provider: BuiltInProviderName; field: 'apiKey' | 'baseUrl' | 'model' } | null {

0 commit comments

Comments
 (0)