treeItem = (tree, parent = '') => {
  const res = [];
  for (const i in tree) {
    if (Object.prototype.hasOwnProperty.call(tree, i)) {
      const item = tree[i];
      const div = document.createElement('div');
      div.className = 'tree__item';
      div.setAttribute('data-file-id', parent + i);
      if (item.type === 'file') {
        div.tabIndex = 0;
        div.addEventListener('click', handleFileEvent(parent + i));
        div.addEventListener('keypress', handleFileEvent(parent + i));
      }
      const title = document.createElement('h3');
      title.className = 'title';
      title.innerHTML = item.name + (item.type === 'directory' ? '/' : '');
      div.appendChild(title);
      if (item.children) {
        const childs = treeItem(item.children, `${parent}${i},`);
        for (const child of childs) {
          div.appendChild(child);
        }
      }
      res.push(div);
    }
  }
  return res;
}
Create tree element
@param {object} tree
@param {string} [parent=]