I have an object as follows:
{
id: "72232915",
entryCode: "999",
conjunction1: "1234567",
conjunction2: "8910111",
conjunction3: "1314151",
date: "08/02/2017"
}
I want to tranform the object into the following format:
{
id: "72232915",
entryCode: "999",
conjunctions: {
1: "1234567"
2: "8910111"
3: "1314151"
},
date: "08/02/2017"
}
Any ideas of how I can achieve the desired output?
Here is Typescript code that does it (very specific to what you are asking):