Let's say I have a type defined like so: type CheeseType = 'Cheddar' | 'Pepperjack' | 'Gouda'.
Given a string, how can I determine whether that string value is in the CheeseType list?
I'm imagining something like if (myString is CheeseType) or if (myString in CheeseType), but these don't seem to work.
ifstatement is related to the runtime and typescript runs before compilingtype CheeseTypeshould be anenum CheeseTypethen? If it was an enum, I could get an array of the string values ofCheeseTypeand see ifmyStringis contained in the array, right?