I am trying to check if a particular key is assigned with only a set of values. This values are listed as an enum in Typescript.
key
values
enum
P
Do something like this:
function isValidRegion(candidate: any): candidate is Regions { return Object.keys(Regions).some(region => region === candidate) }