I have a type
definition, imported from a different npm package, that consists of over 100 strings in union, like this:
type SomeType = "a" | "b" | "c" \\ | ... and it goes and goes
I would like to check in my code if a string variable belongs to this SomeType
. Is there a way to do that which does not require me writing helper functions listing all the possible values (as described here for instance)?
In my case, listing all the values might not be the best, as the type values from that npm package may change in the future and because there is a load of them. I'm looking for some smarter way, if it exists.