MCPcopy Index your code
hub / github.com/MTSWebServices/image-optimize / enumFromStringValue

Function enumFromStringValue

src/utils/enumFromStringValue.ts:1–8  ·  view source on GitHub ↗
(
    enm: { [s: string]: T },
    value: string,
)

Source from the content-addressed store, hash-verified

1export const enumFromStringValue = <T>(
2 enm: { [s: string]: T },
3 value: string,
4): T | undefined => {
5 return (Object.values(enm) as unknown as string[]).includes(value)
6 ? (value as unknown as T)
7 : undefined;
8};

Callers 1

getPreviewMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected