diff --git a/source/index.ts b/source/index.ts index 369ce47..a3a7cf3 100644 --- a/source/index.ts +++ b/source/index.ts @@ -447,7 +447,7 @@ export function isEmptyStringOrWhitespace(value: unknown): value is string { return isEmptyString(value) || isWhitespaceString(value); } -export function isEnumCase(value: unknown, targetEnum: T): boolean { +export function isEnumCase(value: unknown, targetEnum: T): value is T[keyof T] { // eslint-disable-next-line @typescript-eslint/no-unsafe-argument return Object.values(targetEnum as any).includes(value as string); }