How to make a map object type from a union type in TypeScript?
Originally Published Here ๐!
To make a simple map object type from a union type, you can use the in operator in combination with Index Signature syntax in TypeScript.
TL;DR
// String literal union type
type Colors = "blue" | "green" | "red" | "yello...
melvingeorge-me.hashnode.dev3 min read