I have a json like this:
"Client" : {
"ClientId" : "eertertwetw",
"Username" : "c.client",
"Names" : [
{
"Family" : "ClientFamilyName",
"Given" : [
"ClientGivenName"
]
}
]
}
This json is not fixed, so sometimes there are some properties and sometimes not. I need to replace every array inside this Json with the first element of that array. So, for example, in this case it would be like
"Client" : {
"ClientId" : "eertertwetw",
"Username" : "c.client",
"Names" :
{
"Family" : "ClientFamilyName",
"Given" :
"ClientGivenName"
}
]
}
Can anyone help me to find a way to do this with Typescript?
prefixin every object?