export function arrayToTree(list, {parentId = parentId, id = id}) {
  let parents = list.filter(i => !i[parentId])
  list.forEach(item => {
    let children = list.filter(i => i[parentId] === item[id])
    if (children.length) item.children = children
  })
  return parents
}