Given an object of type:
type Key2Value = {
foo: "bar"
voo: "doo"
}
Provided that the values of this type are always string type, how to construct a utility type ReverseMap<T>
that reverse maps the key-value pairs to value-key pairs?
type Value2Key = ReverseMap<Key2Value>
// yields:
type Value2Key = {
bar: "foo"
doo: "voo"
}