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 4c11331 according to the output
from Prettier.

Details: None
  • Loading branch information
deepsource-autofix[bot] authored Jun 8, 2024
1 parent 4c11331 commit c861677
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion packages/main/src/AuthenticationService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class AuthenticationService {
*/
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
14 changes: 7 additions & 7 deletions packages/main/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { verifyLegacyCipherSupport } from "./encryption.js";
type TOnDataHandler = (
port: number,
data: Buffer,
sendToClient: (data: Buffer) => void
sendToClient: (data: Buffer) => void,
) => void;

/**
Expand Down Expand Up @@ -140,19 +140,19 @@ function main() {
3000,
onWebListening,
onWebRequest,
onServerError
onServerError,
);
const loginServer = new TCPServer(
8226,
onSocketListening,
(socket: net.Socket) => onSocketConnection(socket, onNPSData),
onServerError
onServerError,
);
const personaServer = new TCPServer(
8228,
onSocketListening,
(socket: net.Socket) => onSocketConnection(socket, onNPSData),
onServerError
onServerError,
);

const shardService = new ShardService();
Expand All @@ -161,7 +161,7 @@ function main() {
"Rusty Motors",
"A test shard",
"10.10.5.20",
"Group - 1"
"Group - 1",
);

const userLoginService = new AuthenticationService();
Expand All @@ -174,11 +174,11 @@ function main() {
mainLoop.addTask("stop", loginServer.close.bind(loginServer, onServerError));
mainLoop.addTask(
"stop",
personaServer.close.bind(personaServer, onServerError)
personaServer.close.bind(personaServer, onServerError),
);
mainLoop.addTask(
"stop",
userLoginService.clearAllTokens.bind(userLoginService)
userLoginService.clearAllTokens.bind(userLoginService),
);

mainLoop.start();
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 AuthenticationService();
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
2 changes: 1 addition & 1 deletion test/AuthenticationService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,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 c861677

Please sign in to comment.