var treeAll = []
export function recursionTree(data) {
    for (let i = 0; i < data.length; i++) {
        treeAll.push(data[i])    
        if(data[i].children){
            if (data[i].children.length != 0) {
                recursionTree(data[i].children)
            }
        }
    }
    return treeAll
}

var recursionTreeChildrenData = ""
export function recursionTreeChildren(id , dataAll) {
    for (let i = 0; i < dataAll.length; i++) {
        if(dataAll[i].children){
            if(dataAll[i].id == id) {
                recursionTreeChildrenData = dataAll[i].children
            } else {
                recursionTreeChildren(id , dataAll[i].children)
            }
        }
    }
    return recursionTreeChildrenData
}


