mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-05 14:02:02 +00:00
Avoid using as to cast values (#1115)
## Description: - Use `<argument> is <type>` return type declarations in favor of `as`. - Use `satisfies` instead of `as`. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors --------- Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
This commit is contained in:
committed by
evanpelle
parent
e45840c4cf
commit
dccf2b3866
@@ -15,8 +15,8 @@ describe("getMessageTypeClasses", () => {
|
||||
|
||||
it("should return a valid CSS class for every MessageType", () => {
|
||||
const messageTypes = Object.values(MessageType).filter(
|
||||
(value) => typeof value === "number",
|
||||
) as MessageType[];
|
||||
(value): value is MessageType => typeof value === "number",
|
||||
);
|
||||
|
||||
messageTypes.forEach((messageType) => {
|
||||
const result = getMessageTypeClasses(messageType);
|
||||
@@ -30,8 +30,8 @@ describe("getMessageTypeClasses", () => {
|
||||
|
||||
it("should not trigger console.warn for any MessageType", () => {
|
||||
const messageTypes = Object.values(MessageType).filter(
|
||||
(value) => typeof value === "number",
|
||||
) as MessageType[];
|
||||
(value): value is MessageType => typeof value === "number",
|
||||
);
|
||||
|
||||
messageTypes.forEach((messageType) => {
|
||||
getMessageTypeClasses(messageType);
|
||||
|
||||
Reference in New Issue
Block a user