inngest
Version:
Official SDK for Inngest.com. Inngest is the reliability layer for modern applications. Inngest combines durable execution, events, and queues into a zero-infra platform with built-in observability.
1 lines • 588 B
Source Map (JSON)
{"version":3,"file":"enum.cjs","names":[],"sources":["../../src/helpers/enum.ts"],"sourcesContent":["/**\n * Returns the value of an enum from a string value.\n *\n * If the value given is not a value from the enum, `undefined` is returned.\n */\nexport const enumFromValue = <T extends Record<string, unknown>>(\n enumType: T,\n value: unknown,\n): T[keyof T] | undefined => {\n if (Object.values(enumType).includes(value)) {\n return value as T[keyof T];\n }\n\n return;\n};\n"],"mappings":";;;;;;;AAKA,MAAa,iBACX,UACA,UAC2B;AAC3B,KAAI,OAAO,OAAO,SAAS,CAAC,SAAS,MAAM,CACzC,QAAO"}