mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-14 22:02:59 -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
@@ -115,9 +115,9 @@ async function initOauthClient(
|
||||
|
||||
if (
|
||||
credentials &&
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
||||
(credentials as { type?: string }).type ===
|
||||
'external_account_authorized_user'
|
||||
typeof credentials === 'object' &&
|
||||
'type' in credentials &&
|
||||
credentials.type === 'external_account_authorized_user'
|
||||
) {
|
||||
const auth = new GoogleAuth({
|
||||
scopes: OAUTH_SCOPE,
|
||||
@@ -603,9 +603,10 @@ export function getAvailablePort(): Promise<number> {
|
||||
}
|
||||
const server = net.createServer();
|
||||
server.listen(0, () => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
||||
const address = server.address()! as net.AddressInfo;
|
||||
port = address.port;
|
||||
const address = server.address();
|
||||
if (address && typeof address === 'object') {
|
||||
port = address.port;
|
||||
}
|
||||
});
|
||||
server.on('listening', () => {
|
||||
server.close();
|
||||
|
||||
Reference in New Issue
Block a user