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 1dab559 according to the output
from Prettier.

Details: None
  • Loading branch information
deepsource-autofix[bot] authored Jun 8, 2024
1 parent 1dab559 commit 6473ca7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 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,

Check warning on line 21 in packages/main/src/UserLoginService.ts

View check run for this annotation

Codecov / codecov/patch

packages/main/src/UserLoginService.ts#L21

Added line #L21 was not covered by tests
);

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,

Check warning on line 33 in packages/main/src/index.ts

View check run for this annotation

Codecov / codecov/patch

packages/main/src/index.ts#L33

Added line #L33 was not covered by tests
) => void;

/**
Expand Down Expand Up @@ -140,19 +140,19 @@ function main() {
3000,
onWebListening,
onWebRequest,
onServerError
onServerError,

Check warning on line 143 in packages/main/src/index.ts

View check run for this annotation

Codecov / codecov/patch

packages/main/src/index.ts#L143

Added line #L143 was not covered by tests
);
const loginServer = new TCPServer(
8226,
onSocketListening,
(socket: net.Socket) => onSocketConnection(socket, onNPSData),
onServerError
onServerError,

Check warning on line 149 in packages/main/src/index.ts

View check run for this annotation

Codecov / codecov/patch

packages/main/src/index.ts#L149

Added line #L149 was not covered by tests
);
const personaServer = new TCPServer(
8228,
onSocketListening,
(socket: net.Socket) => onSocketConnection(socket, onNPSData),
onServerError
onServerError,

Check warning on line 155 in packages/main/src/index.ts

View check run for this annotation

Codecov / codecov/patch

packages/main/src/index.ts#L155

Added line #L155 was not covered by tests
);

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",

Check warning on line 164 in packages/main/src/index.ts

View check run for this annotation

Codecov / codecov/patch

packages/main/src/index.ts#L164

Added line #L164 was not covered by tests
);

const userLoginService = new UserLoginService();
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),

Check warning on line 177 in packages/main/src/index.ts

View check run for this annotation

Codecov / codecov/patch

packages/main/src/index.ts#L177

Added line #L177 was not covered by tests
);
mainLoop.addTask(
"stop",
userLoginService.clearAllTokens.bind(userLoginService)
userLoginService.clearAllTokens.bind(userLoginService),

Check warning on line 181 in packages/main/src/index.ts

View check run for this annotation

Codecov / codecov/patch

packages/main/src/index.ts#L181

Added line #L181 was not covered by tests
);

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 @@ -25,7 +25,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`,

Check warning on line 28 in packages/main/src/web.ts

View check run for this annotation

Codecov / codecov/patch

packages/main/src/web.ts#L28

Added line #L28 was not covered by tests
);
}

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

Check warning on line 37 in packages/main/src/web.ts

View check run for this annotation

Codecov / codecov/patch

packages/main/src/web.ts#L37

Added line #L37 was not covered by tests
);
}

Expand All @@ -56,7 +56,7 @@ function authLogin(
req: IncomingMessage,
res: ServerResponse,
username: string,
password: string
password: string,

Check warning on line 59 in packages/main/src/web.ts

View check run for this annotation

Codecov / codecov/patch

packages/main/src/web.ts#L59

Added line #L59 was not covered by tests
) {
const userLoginService = new UserLoginService();
const customerId = userLoginService.authenticateUser(username, password);
Expand Down Expand Up @@ -87,7 +87,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",

Check warning on line 90 in packages/main/src/web.ts

View check run for this annotation

Codecov / codecov/patch

packages/main/src/web.ts#L90

Added line #L90 was not covered by tests
);

const certificate = await readFile("data/mcouniverse.crt");
Expand Down

0 comments on commit 6473ca7

Please sign in to comment.