diff --git a/server/eslint.config.js b/server/eslint.config.js index 5ca8c4268..c854029a0 100755 --- a/server/eslint.config.js +++ b/server/eslint.config.js @@ -12,7 +12,7 @@ ESlint v9 configuration is different than v8. /** @type {import('eslint').Linter.Config[]} */ export default [ { - ignores: ["dist/**", "node_modules/**", "coverage/**"], + ignores: ["dist/**", "node_modules/**", "coverage/**", "test/**"], }, { languageOptions: { diff --git a/server/src/service/infrastructure/networkService.ts b/server/src/service/infrastructure/networkService.ts index 3cf24ccf6..0c164d10d 100644 --- a/server/src/service/infrastructure/networkService.ts +++ b/server/src/service/infrastructure/networkService.ts @@ -455,10 +455,10 @@ class NetworkService implements INetworkService { // Priority-based matching to avoid ambiguity: // 1. Exact full ID match (64-char) - let exactIdMatch = containers.find((c: any) => c.Id.toLowerCase() === normalizedInput); + const exactIdMatch = containers.find((c: any) => c.Id.toLowerCase() === normalizedInput); // 2. Exact container name match (case-insensitive) - let exactNameMatch = containers.find((c: any) => + const exactNameMatch = containers.find((c: any) => c.Names.some((name: string) => { const cleanName = name.replace(/^\/+/, "").toLowerCase(); return cleanName === normalizedInput; @@ -466,10 +466,10 @@ class NetworkService implements INetworkService { ); // 3. Partial ID match (fallback for backwards compatibility) - let partialIdMatch = containers.find((c: any) => c.Id.toLowerCase().startsWith(normalizedInput)); + const partialIdMatch = containers.find((c: any) => c.Id.toLowerCase().startsWith(normalizedInput)); // Select container based on priority - let targetContainer = exactIdMatch || exactNameMatch || partialIdMatch; + const targetContainer = exactIdMatch || exactNameMatch || partialIdMatch; // Return negative response if no container if (!targetContainer) { diff --git a/server/src/utils/imageProcessing.ts b/server/src/utils/imageProcessing.ts index 442f0d6da..07ba3d87f 100755 --- a/server/src/utils/imageProcessing.ts +++ b/server/src/utils/imageProcessing.ts @@ -1,22 +1,18 @@ import sharp from "sharp"; const GenerateAvatarImage = async (file: Express.Multer.File) => { - try { - // Resize to target 64 * 64 - let resizedImageBuffer = await sharp(file.buffer) - .resize({ - width: 64, - height: 64, - fit: "cover", - }) - .toBuffer(); + // Resize to target 64 * 64 + let resizedImageBuffer = await sharp(file.buffer) + .resize({ + width: 64, + height: 64, + fit: "cover", + }) + .toBuffer(); - //Get b64 string - const base64Image = resizedImageBuffer.toString("base64"); - return base64Image; - } catch (error) { - throw error; - } + //Get b64 string + const base64Image = resizedImageBuffer.toString("base64"); + return base64Image; }; export { GenerateAvatarImage }; diff --git a/server/src/utils/logger.ts b/server/src/utils/logger.ts index 4053f4a82..e3c0db169 100755 --- a/server/src/utils/logger.ts +++ b/server/src/utils/logger.ts @@ -44,7 +44,7 @@ class Logger implements ILogger { this.maxCacheSize = 1000; const consoleFormat = format.printf((info: Logform.TransformableInfo) => { const { level, service, method, details, timestamp, stack } = info; - let message = info.message as string; + const message = info.message as string; let formattedMessage: string = message; let formattedDetails: string | undefined; @@ -57,10 +57,10 @@ class Logger implements ILogger { } let msg = `${timestamp} ${level}:`; - service && (msg += ` [${service}]`); - method && (msg += `(${method})`); - formattedMessage && (msg += ` ${formattedMessage}`); - formattedDetails && (msg += ` (details: ${formattedDetails})`); + if (service) msg += ` [${service}]`; + if (method) msg += `(${method})`; + if (formattedMessage) msg += ` ${formattedMessage}`; + if (formattedDetails) msg += ` (details: ${formattedDetails})`; if (typeof stack === "string") { const stackTrace = stack