I have a TypeScript object structure that resembles the following:
{
"obj1" : { object: type1;};
"obj2" : { object: type2;};
"obj3" : { object: type3;};
"obj4" : { object: type4;};
"obj5" : { object: type5;};
}
My goal is to transform it into:
{
"obj1" : type1;
"obj2" : type2;
"obj3" : type3;
"obj4" : type4;
"obj5" : type5;
}
I am specifically concerned about maintaining the types while performing this transformation.
I am currently utilizing TypeScript version 3.7.2, however, I am open to solutions from later versions as well.
Can anyone provide assistance with this?
UPDATE ---- It's important to clarify that my issue revolves around preserving the typings rather than simply mapping objects. I want the types of my objects to be accurately represented during compile time.