We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8aee608 commit e01f3b3Copy full SHA for e01f3b3
src/interfaces.ts
@@ -148,10 +148,10 @@ export enum FormatEnum {
148
CLIENT = 'CLIENT',
149
PRECOMPUTED = 'PRECOMPUTED',
150
}
151
-// enums are a little sticky to work with in conjunction with serialization.
+
152
export function getFormatFromString(str: string | null): FormatEnum {
153
// default to SERVER. Should always be set, but the ConfigurationStore allows null.
154
- return Object.values(FormatEnum).find((val) => val === str) ?? FormatEnum.SERVER;
+ return FormatEnum[str as keyof typeof FormatEnum] ?? FormatEnum.SERVER;
155
156
157
export type BasePrecomputedFlag = {
0 commit comments