Refactor imports across multiple components for consistency and clarity
- Reorganized import statements in various components to ensure consistent ordering and grouping. - Removed unnecessary imports and added missing ones where applicable. - Improved readability and maintainability of the codebase by standardizing import styles.
This commit is contained in:
@@ -39,7 +39,7 @@ export function recordTrafficError(error: Error, component: string) {
|
||||
*/
|
||||
function getMemoryUsage(): number {
|
||||
if ("memory" in performance) {
|
||||
// @ts-ignore - 某些浏览器支持
|
||||
// @@ts-expect-error - 某些浏览器支持
|
||||
const memory = (performance as any).memory;
|
||||
if (memory && memory.usedJSHeapSize) {
|
||||
return memory.usedJSHeapSize / 1024 / 1024; // 转换为MB
|
||||
|
||||
@@ -506,9 +506,11 @@ function URI_VLESS(line: string): IProxyVlessConfig {
|
||||
parsed = /^(.*?)@(.*?):(\d+)\/?(\?(.*?))?(?:#(.*?))?$/.exec(line)!;
|
||||
isShadowrocket = true;
|
||||
}
|
||||
let [__, uuid, server, portStr, ___, addons = "", name] = parsed;
|
||||
const [, uuidRaw, server, portStr, , addons = "", nameRaw] = parsed;
|
||||
let uuid = uuidRaw;
|
||||
let name = nameRaw;
|
||||
if (isShadowrocket) {
|
||||
uuid = uuid.replace(/^.*?:/g, "");
|
||||
uuid = uuidRaw.replace(/^.*?:/g, "");
|
||||
}
|
||||
|
||||
const port = parseInt(portStr, 10);
|
||||
@@ -598,6 +600,7 @@ function URI_VLESS(line: string): IProxyVlessConfig {
|
||||
proxy.network = "grpc";
|
||||
break;
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user