Skip to content

Commit 39a3e8b

Browse files
committed
o(1) enum conversion
1 parent 8aee608 commit 39a3e8b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/interfaces.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ export enum FormatEnum {
151151
// enums are a little sticky to work with in conjunction with serialization.
152152
export function getFormatFromString(str: string | null): FormatEnum {
153153
// default to SERVER. Should always be set, but the ConfigurationStore allows null.
154-
return Object.values(FormatEnum).find((val) => val === str) ?? FormatEnum.SERVER;
154+
return FormatEnum[str as keyof typeof FormatEnum] ?? FormatEnum.SERVER;
155155
}
156156

157157
export type BasePrecomputedFlag = {

0 commit comments

Comments
 (0)