Skip to content

Commit a8c92eb

Browse files
committed
Remove function comments as per expected code guidance
1 parent 564e45c commit a8c92eb

File tree

4 files changed

+0
-41
lines changed

4 files changed

+0
-41
lines changed

packages/main/src/backend/proxyConfig/agentManager.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ interface ProxyState {
1515

1616
let proxyState: ProxyState | null = null;
1717

18-
/**
19-
* Initializes global proxy agents for HTTP/HTTPS and fetch()
20-
*/
2118
export function initializeProxyAgents(proxyUrl: string): void {
2219
if (proxyState?.proxyUrl === proxyUrl) {
2320
logger.log(`Proxy already initialized with ${proxyUrl}`);
@@ -49,9 +46,6 @@ export function initializeProxyAgents(proxyUrl: string): void {
4946
setGlobalDispatcher(undiciProxyAgent);
5047
}
5148

52-
/**
53-
* Restores original global agents and clears proxy configuration
54-
*/
5549
export function tearDownProxyAgents(): void {
5650
if (!proxyState) {
5751
return;
@@ -74,9 +68,6 @@ export function tearDownProxyAgents(): void {
7468
proxyState = null;
7569
}
7670

77-
/**
78-
* Gets current proxy URL if configured
79-
*/
8071
export function getCurrentProxyUrl(): string | null {
8172
return proxyState?.proxyUrl ?? null;
8273
}

packages/main/src/backend/proxyConfig/index.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,10 @@ import { fetchPacFile, extractProxyFromPac, invalidatePacCache } from './pacFile
33
import { getWindowsProxySettings } from './windowsRegistry';
44
import { initializeProxyAgents, tearDownProxyAgents, getCurrentProxyUrl } from './agentManager';
55

6-
/**
7-
* Normalizes proxy URL to ensure it has a protocol
8-
*/
96
function normalizeProxyUrl(url: string): string {
107
return url.startsWith('http') ? url : `http://${url}`;
118
}
129

13-
/**
14-
* Attempts to extract proxy from PAC file
15-
*/
1610
async function getProxyFromPacFile(pacUrl: string): Promise<string | undefined> {
1711
try {
1812
const pacContent = await fetchPacFile(pacUrl);
@@ -28,9 +22,6 @@ async function getProxyFromPacFile(pacUrl: string): Promise<string | undefined>
2822
return undefined;
2923
}
3024

31-
/**
32-
* Determines proxy configuration from environment variables or Windows Registry
33-
*/
3425
async function getProxyConfiguration(): Promise<string | undefined> {
3526
// Check environment variables first
3627
const envProxyUrl = process.env.HTTP_PROXY ?? process.env.HTTPS_PROXY;
@@ -58,9 +49,6 @@ async function getProxyConfiguration(): Promise<string | undefined> {
5849
return undefined;
5950
}
6051

61-
/**
62-
* Initializes proxy configuration if available and not already set
63-
*/
6452
export async function initProxyIfNeeded(): Promise<void> {
6553
const proxyUrl = await getProxyConfiguration();
6654
if (proxyUrl) {
@@ -70,17 +58,11 @@ export async function initProxyIfNeeded(): Promise<void> {
7058
}
7159
}
7260

73-
/**
74-
* Tears down proxy configuration and clears cache for fresh start next time
75-
*/
7661
export function tearDownProxy(): void {
7762
tearDownProxyAgents();
7863
invalidatePacCache();
7964
}
8065

81-
/**
82-
* Gets proxy arguments for Chromium
83-
*/
8466
export function getProxyArgs(): string[] {
8567
const proxyUrl = getCurrentProxyUrl();
8668
if (proxyUrl) {

packages/main/src/backend/proxyConfig/pacFile.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ interface CachedPacFile {
1414

1515
let cachedPacContent: CachedPacFile | null = null;
1616

17-
/**
18-
* Fetches PAC file content from URL with caching
19-
*/
2017
export async function fetchPacFile(pacUrl: string, bustCache = false): Promise<string> {
2118
// Return cached content if valid
2219
if (!bustCache && cachedPacContent?.url === pacUrl) {
@@ -59,10 +56,6 @@ export async function fetchPacFile(pacUrl: string, bustCache = false): Promise<s
5956
});
6057
}
6158

62-
/**
63-
* Extracts proxy server from PAC file content
64-
* Looks for PROXY directives in the PAC file
65-
*/
6659
export function extractProxyFromPac(pacContent: string): string | undefined {
6760
// Look for return statements with PROXY directives
6861
// Common patterns: "PROXY proxy.example.com:8080" or "PROXY host:port; DIRECT"
@@ -73,9 +66,6 @@ export function extractProxyFromPac(pacContent: string): string | undefined {
7366
return undefined;
7467
}
7568

76-
/**
77-
* Invalidates cached PAC file content, forcing re-fetch on next call
78-
*/
7969
export function invalidatePacCache(): void {
8070
cachedPacContent = null;
8171
}

packages/main/src/backend/proxyConfig/windowsRegistry.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ export interface WindowsProxySettings {
66
autoConfigUrl?: string;
77
}
88

9-
/**
10-
* Reads proxy settings from Windows Registry
11-
* Checks HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings
12-
*/
139
const REGISTRY_PATH = '\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings';
1410
const REGISTRY_KEYS = {
1511
PROXY_SERVER: 'ProxyServer',

0 commit comments

Comments
 (0)