I currently have an object that resembles the following:
const obj = {
id: 1,
name: {
"english-us": "John",
"english-uk": "John",
"italian-eu": "Giovanni",
},
};
My goal is to convert all property names that are strings into non-string ones, like so:
const obj = {
id: 1,
name: {
english_us: "John",
english_uk: "John",
italian_eu: "Giovanni",
},
};
It's worth noting that I'm unable to alter the original object as it comes from an axios request.