This is a follow up question for TypeScript map function to change property type.
If I have the following
class A { }
class B { }
var var1 = [{ path: "aa", comp: "A" }, { path: "b", comp: "B" }];
Is there a way to programmatically generate a mapping object like this
var nameToClassMapping = {
A: A,
B: B
};
rather than hardcode it?