Skip to content

Commit 862865a

Browse files
author
kim
committed
refactor: use number parseint
1 parent 3cac0b5 commit 862865a

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

cypress/support/server.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -593,8 +593,8 @@ export const mockGetMemberStorageFiles = (
593593
({ url, reply }) => {
594594
const params = new URL(url).searchParams;
595595

596-
const page = window.parseInt(params.get('page') ?? '1');
597-
const pageSize = window.parseInt(params.get('pageSize') ?? '10', 10);
596+
const page = Number.parseInt(params.get('page') ?? '1');
597+
const pageSize = Number.parseInt(params.get('pageSize') ?? '10', 10);
598598

599599
const result = files.slice((page - 1) * pageSize, page * pageSize);
600600

@@ -792,8 +792,8 @@ export const mockGetAccessibleItems = (items: ItemForTest[]): void => {
792792
({ url, reply }) => {
793793
const params = new URL(url).searchParams;
794794

795-
const page = parseInt(params.get('page') ?? '1', 10);
796-
const pageSize = parseInt(params.get('pageSize') ?? '10', 10);
795+
const page = Number.parseInt(params.get('page') ?? '1', 10);
796+
const pageSize = Number.parseInt(params.get('pageSize') ?? '10', 10);
797797

798798
// warning: we don't check memberships
799799
const root = items.filter(isRootItem);
@@ -824,8 +824,8 @@ export const mockGetOwnRecycledItemData = (
824824

825825
const params = new URL(url).searchParams;
826826

827-
const page = parseInt(params.get('page') ?? '1', 10);
828-
const pageSize = parseInt(params.get('pageSize') ?? '10', 10);
827+
const page = Number.parseInt(params.get('page') ?? '1', 10);
828+
const pageSize = Number.parseInt(params.get('pageSize') ?? '10', 10);
829829

830830
const result = recycledItemData.slice(
831831
(page - 1) * pageSize,

src/modules/analytics/charts/ActionsByTimeOfDayChart.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const ActionsByTimeOfDayChart = ({
6565
data={Object.values(
6666
data as { [key: string]: { hour: string } },
6767
).toSorted((a, b) =>
68-
parseInt(a.hour) > parseInt(b.hour) ? 1 : -1,
68+
Number.parseInt(a.hour) > Number.parseInt(b.hour) ? 1 : -1,
6969
)}
7070
>
7171
<CartesianGrid strokeDasharray="2" />

src/ui/Avatar/stringToColor.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import { hslToRgb } from '@mui/material';
77
*/
88
export const getColorFromId = (id: string): string => {
99
const rawHue = id.slice(0, 2);
10-
const hue = (parseInt(rawHue, 16) / 256) * 360;
10+
const hue = (Number.parseInt(rawHue, 16) / 256) * 360;
1111
const rawSaturation = id[2];
12-
const saturation = 65 + (16 - parseInt(rawSaturation, 16));
12+
const saturation = 65 + (16 - Number.parseInt(rawSaturation, 16));
1313
const newRgb = hslToRgb(`hsl(${hue}, ${saturation}, ${60})`);
1414
return newRgb;
1515
};

src/ui/items/H5PItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ const H5PItem = ({
8686
return;
8787
}
8888
// height should be int
89-
const newHeight = parseInt(event.data.height);
89+
const newHeight = Number.parseInt(event.data.height);
9090
iframeRef.current.height = newHeight.toString();
9191
};
9292

vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const config = ({ mode }: { mode: string }): UserConfig => {
3232
}
3333

3434
// compute the port to use
35-
const PORT = parseInt(VITE_PORT ?? '3114', 10);
35+
const PORT = Number.parseInt(VITE_PORT ?? '3114', 10);
3636
// compute whether we should open the browser
3737
// this defines if we should automatically open the browser
3838
const shouldOpen = BROWSER && BROWSER !== 'none';

0 commit comments

Comments
 (0)