I have some complex types:
type odds: 1 | 3 | 5 | 7 | 9; type evens: 2 | 4 | 6 | 8 | 0 ...and some function which takes those complex types:
function(digit: odds | evens) { ... } I would like to check which type I'm getting, but none of the following work:
if (digit isntanceof odds) // error: odds refers to a type but is being used as a value if (typeof digit === ???) // issue: no single value for typeof .
How can I go about checking if digit is odd using types?