function collapseAll(node) {
      while (node.children && node.children.length === 1) {
        const child = node.children[0];
        node.name += '/' + child.name;
        if (child.duplicatedNormalizedModuleName) {
          node.duplicatedNormalizedModuleName = child.duplicatedNormalizedModuleName;
        }
        node.children = child.children;
      }

      if (node.children) {
        for (const child of node.children) {
          collapseAll(child);
        }
      }
    }
Collapse nodes that have only one child.
@param {LH.Treemap.Node} node