const recurse = (item: Object | string) => {
if(typeof item !== 'string'){
const keys = Object.keys(item);
keys.forEach(key => recurse(item[key]));
// I don't know how I should loop through the items in a way that would allow me to return the key and value correctly here 😭
} else {
// I don't know how to return the result to the right key here 😭
return serialize(item)
}
}
const recurse = (item: Object | string) => {
if(typeof item !== 'string'){
const keys = Object.keys(item);
keys.forEach(key => recurse(item[key]));
// I don't know how I should loop through the items in a way that would allow me to return the key and value correctly here 😭
} else {
// I don't know how to return the result to the right key here 😭
return serialize(item)
}
}