I have a Typescript object that will look like this:
{
"obj1" : { object: type1;};
"obj2" : { object: type2;};
"obj3" : { object: type3;};
"obj4" : { object: type4;};
"obj5" : { object: type5;};
}
I want to map it to
{
"obj1" : type1;
"obj2" : type2;
"obj3" : type3;
"obj4" : type4;
"obj5" : type5;
}
My concern is preserving types here.
I am using typescript 3.7.2 let me know even if there is a solution in a later version.
Can anyone help ?
UPDATE ---- My problem is typing not object mapping. I want the types of my objects to be reflected in compile time.