Skip to content

Commit

Permalink
style: format code with Prettier
Browse files Browse the repository at this point in the history
This commit fixes the style issues introduced in be0f51a according to the output
from Prettier.

Details: None
  • Loading branch information
deepsource-autofix[bot] authored Jun 8, 2024
1 parent be0f51a commit d0e7113
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/main/src/UserLoginService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class UserLoginService {
*/
authenticateUser(username: string, password: string): number {
const user = userCredentials.find(
(user) => user.username === username && user.password === password
(user) => user.username === username && user.password === password,
);

return user ? user.customerId : -1;
Expand Down
8 changes: 4 additions & 4 deletions packages/main/src/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function sendError(res: ServerResponse, statusCode: number, message: string) {
res.statusCode = statusCode;
res.setHeader("Content-Type", "text/plain");
res.end(
`reasoncode=INV-200\nreasontext=${message}\nreasonurl=https://rusty-motors.com`
`reasoncode=INV-200\nreasontext=${message}\nreasonurl=https://rusty-motors.com`,
);
}

Expand All @@ -35,7 +35,7 @@ function sendCastanetResponse(res: ServerResponse) {
res.end(
Buffer.from([
0xca, 0xfe, 0xbe, 0xef, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03,
])
]),
);
}

Expand All @@ -57,7 +57,7 @@ function authLogin(
req: IncomingMessage,
res: ServerResponse,
username: string,
password: string
password: string,
) {
const userLoginService = new UserLoginService();
const customerId = userLoginService.authenticateUser(username, password);
Expand Down Expand Up @@ -95,7 +95,7 @@ async function getSetupupFiles(path: string, res: ServerResponse) {
res.setHeader("Content-Type", "text/plain");
res.setHeader(
"Content-Disposition",
"attachment; filename=certificate.crt"
"attachment; filename=certificate.crt",
);

const certificate = await readFile("data/mcouniverse.crt");
Expand Down
3 changes: 1 addition & 2 deletions test/UserLoginService.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import { beforeEach, describe, expect, it } from "vitest";
import { UserLoginService } from "../packages/main/src/UserLoginService.js";

Expand All @@ -17,7 +16,7 @@ describe("UserLoginService", () => {
it("should not authenticate a user with invalid credentials", () => {
const customerId = userLoginService.authenticateUser(
"admin",
"wrongpassword"
"wrongpassword",
);
expect(customerId).toBe(-1);
});
Expand Down

0 comments on commit d0e7113

Please sign in to comment.