mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-14 07:10:34 -07:00
Fix unsafe assertions in code_assist folder. (#19706)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
c04602f209
commit
b7555ab1e1
@@ -35,7 +35,7 @@ export async function getExperiments(
|
||||
const expPath = process.env['GEMINI_EXP'];
|
||||
debugLogger.debug('Reading experiments from', expPath);
|
||||
const content = await fs.promises.readFile(expPath, 'utf8');
|
||||
const response = JSON.parse(content);
|
||||
const response: ListExperimentsResponse = JSON.parse(content);
|
||||
if (
|
||||
(response.flags && !Array.isArray(response.flags)) ||
|
||||
(response.experimentIds && !Array.isArray(response.experimentIds))
|
||||
@@ -44,8 +44,7 @@ export async function getExperiments(
|
||||
'Invalid format for experiments file: `flags` and `experimentIds` must be arrays if present.',
|
||||
);
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
||||
return parseExperiments(response as ListExperimentsResponse);
|
||||
return parseExperiments(response);
|
||||
} catch (e) {
|
||||
debugLogger.debug('Failed to read experiments from GEMINI_EXP', e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user