Object.keys(obj).forEach((item, idx) => {
if (typeof obj[item] === 'object') {
if (obj[item].active) obj[item].active = false
recursion(obj[item])
}
})
let recursion = (obj) => {
Object.keys(obj).forEach((item, idx) => {
if (typeof obj[item] === 'object') {
obj[item].active = false
recursion(obj[item])
} else if (typeof obj[item] === 'string') {
obj[item] = {
value: obj[item],
active: false
}
}
})
}
recursion(res.data)