Skip to content

Commit babe98b

Browse files
committed
chore: formatting
1 parent c03b879 commit babe98b

File tree

5 files changed

+17
-12
lines changed

5 files changed

+17
-12
lines changed

src/__tests__/js/networking.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,10 @@ describe('networking as a hivemind', () => {
302302
name: testName,
303303
});
304304

305-
expect(messagesTo.map(m => m.msg)).toContainEqual({
305+
expect(messagesTo.map((m) => m.msg)).toContainEqual({
306306
type: Messages.NEW_PROBLEM,
307-
problem: testProblem
307+
problem: testProblem,
308308
});
309-
})
309+
});
310310
});
311311
});

src/components/JoinLink.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<script>
2-
import { id as id_, isHivemindBrain as isHivemindBrain_ } from '@/js/store.js';
2+
import {
3+
id as id_,
4+
isHivemindBrain as isHivemindBrain_,
5+
} from '@/js/store.js';
36
import { getJoinLink } from '@/js/cryptoduelutils.js';
47
58
export let id = id_;

src/js/networking.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ import {
1313
solved,
1414
users,
1515
} from './store.js';
16-
import {
17-
external,
18-
Messages,
19-
} from './constants.js';
16+
import { external, Messages } from './constants.js';
2017
import { log } from './utils.js';
2118

2219
export const peer = new external.Peer();
@@ -61,7 +58,7 @@ const initializeRemotePlayer = (id, data) => {
6158
if (!connections.has(id) || $problem === null) return;
6259
connections.get(id)?.send({
6360
type: Messages.NEW_PROBLEM,
64-
problem: $problem
61+
problem: $problem,
6562
});
6663
};
6764

src/js/quotes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const getQuoteGenerator = () => {
1111
let quoteIndex = 0;
1212

1313
const chunk = fetch(
14-
`./quotes/${Math.floor(Math.random() * (amountChunks))}.json`
14+
`./quotes/${Math.floor(Math.random() * amountChunks)}.json`
1515
)
1616
.then((r) => r.json())
1717
.then(shuffleArray);

src/js/store.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,13 @@ const defaultUsers = [
1414
},
1515
].slice(1);
1616

17-
export const hivemindBrain = writable(new URLSearchParams(location.search).get('game'));
18-
export const isHivemindBrain = derived(hivemindBrain, $brainid => $brainid === null);
17+
export const hivemindBrain = writable(
18+
new URLSearchParams(location.search).get('game')
19+
);
20+
export const isHivemindBrain = derived(
21+
hivemindBrain,
22+
($brainid) => $brainid === null
23+
);
1924

2025
/** @typedef {typeof defaultUsers[0]} User */
2126
/** @typedef {import('peerjs').DataConnection} Connection */

0 commit comments

Comments
 (0)