Skip to content

Commit

Permalink
Avoid unnecessary type assertions by correctly typing the const - App…
Browse files Browse the repository at this point in the history
…ly suggestions from code review

Co-authored-by: davemarco <[email protected]>
  • Loading branch information
junhaoliao and davemarco authored Sep 4, 2024
1 parent b9d6e76 commit 3a6d3de
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions new-log-viewer/src/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,12 +208,12 @@ const Layout = () => {
};

const handleLogLevelSelectChange = (ev: React.ChangeEvent<HTMLSelectElement>) => {
const selected = Array.from(ev.target.options)
const selected: LOG_LEVEL[] = Array.from(ev.target.options)
.map((option) => option.selected && Number(option.value))
.filter((value) => "number" === typeof value);

setSelectedLogLevels(selected as number[]);
changeLogLevelFilter(selected as unknown as LogLevelFilter);
setSelectedLogLevels(selected);
changeLogLevelFilter(selected);
};

/**
Expand Down

0 comments on commit 3a6d3de

Please sign in to comment.