Skip to content

Commit 45410ec

Browse files
author
Jeff
committed
move to a const lambda
1 parent aa129dc commit 45410ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sogs/static/view_room.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const makebuffer = (raw) => {
1010
return b.subarray(0, realLength);
1111
};
1212

13-
function formatBytes(bytes, decimals = 2) {
13+
const formatBytes = (bytes, decimals = 2) => {
1414
if (bytes === 0) return '0 Bytes';
1515

1616
const k = 1024;
@@ -20,7 +20,7 @@ function formatBytes(bytes, decimals = 2) {
2020
const i = Math.floor(Math.log(bytes) / Math.log(k));
2121

2222
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
23-
}
23+
};
2424

2525
const setup = async () => {
2626
const elem = document.getElementById("messages");

0 commit comments

Comments
 (0)