In the documentation for Typescript, a type is defined to be used as keys into a Record<>. It seems like this is done to restrict and secure the keys that can be utilized.
type CatName = "miffy" | "boris" | "mordred";
What exactly is this type? How can I search through it to check if it includes a specific string value, like checking if "bart" is one of its allowed values?
If we consider the earlier union type being used as a key in a Record based on the docs:
const cats: Record<CatName, CatInfo> = {}
But what happens if, during runtime, we receive data for a cat name not included in the predefined list, for example 'bart', and try to add an entry for that new cat name? Will this result in an error?