forked from orbit-oss/is
parent
f7148e19dc
commit
0df21e4151
1 changed files with 1 additions and 1 deletions
|
|
@ -447,7 +447,7 @@ export function isEmptyStringOrWhitespace(value: unknown): value is string {
|
|||
return isEmptyString(value) || isWhitespaceString(value);
|
||||
}
|
||||
|
||||
export function isEnumCase<T = unknown>(value: unknown, targetEnum: T): boolean {
|
||||
export function isEnumCase<T = unknown>(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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue