Inference heavy mapping function (Typescript challenge!) - Theo's Typesafe Cult