The typescript docs here define a type to use as keys into a Record<>. I assume this is to limit and lock down the keys that can be used.
type CatName = "miffy" | "boris" | "mordred";
What kind of type is that? How do I search within it to see if it contains a string value? As in, how do I test it to see if "bart" is one of its "allowed" values?
Using the docs again, suppose the union type above is used as a key in a Record, like this:
const cats: Record<CatName, CatInfo> = {}
What if, at run time, we receive data on the wire for a different cat name and we try to create a record entry for that different cat name, as in 'bart'? This will generate an error, yes?