mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
fix(memory): correct operator precedence in listEmbeddingProviders hasKey check (TS18047)
The previous expression was parsed as (A && B && C) || D, allowing D to evaluate with creds possibly null. Wrap (apiKey || accessToken) in parens so creds-narrowing covers the whole disjunction.
This commit is contained in:
@@ -256,8 +256,8 @@ export async function listEmbeddingProviders(): Promise<EmbeddingProviderListing
|
||||
hasKey = !!(
|
||||
creds &&
|
||||
!("allRateLimited" in creds && creds.allRateLimited) &&
|
||||
("apiKey" in creds ? !!creds.apiKey : false) ||
|
||||
("accessToken" in creds ? !!creds.accessToken : false)
|
||||
(("apiKey" in creds ? !!creds.apiKey : false) ||
|
||||
("accessToken" in creds ? !!creds.accessToken : false))
|
||||
);
|
||||
} catch {
|
||||
hasKey = false;
|
||||
|
||||
Reference in New Issue
Block a user