function stringEnumValidator<T>(enumMap): (x) => x is Object extends T ? never : T[keyof T]
Creates a validator which tests if the target is a string
and is one of the values in the specified enum (object).
Type parameters
Type parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
enumMap | T |
Returns
Function
Parameters
Parameter | Type |
---|---|
x | unknown |
Returns
x is Object extends T ? never : T[keyof T]