Skip to content

Commit

Permalink
fix: address ESLINT and Prettier complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieSlome committed Feb 8, 2024
1 parent dbcd124 commit 87ae8cb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/proxy/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ router.use(
message = action.blockedMessage;
}

packetMessage = handleMessage(message);
const packetMessage = handleMessage(message);

res.status(200).send(packetMessage);

Expand All @@ -64,13 +64,13 @@ router.use(
}),
);

const handleMessage = async(message) => {
const handleMessage = async (message) => {
const errorMessage = `ERR\t${message}`;
const len = 6 + new TextEncoder().encode(errorMessage).length;

const prefix = len.toString(16);
const packetMessage = `${prefix.padStart(4, '0')}\x02${errorMessage}\n0000`;
return packetMessage
}
return packetMessage;
};

module.exports = {router, handleMessage};
module.exports = { router, handleMessage };
4 changes: 2 additions & 2 deletions src/ui/components/Snackbar/Snackbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ export default function Snackbar(props) {
place.indexOf('l') !== -1
? 'left'
: place.indexOf('c') !== -1
? 'center'
: 'right',
? 'center'
: 'right',
}}
open={open}
message={
Expand Down
2 changes: 0 additions & 2 deletions test/testProxyRoute.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@

const handleMessage = require('../src/proxy/routes').handleMessage;
const chai = require('chai');

const expect = chai.expect;

// Use this test as a template
describe('proxy error messages', async () => {

it('should handle short messages', async function () {
const res = await handleMessage('one');
expect(res).to.contain('one');
Expand Down

0 comments on commit 87ae8cb

Please sign in to comment.