code: function traverseTree(
    url: ParsedURL,
    tree: TreeDirectory,
    debuggeeHost: ?string,
    source: Source
  ): TreeNode {
    const parts = url.path.split("/").filter(p => p !== "");
    parts.unshift(url.group);
  
    let path = "";
    return parts.reduce((subTree, part, index) => {
      path = path ? `${path}/${part}` : part;
      const debuggeeHostIfRoot = index === 0 ? debuggeeHost : null;
      return findOrCreateNode(
        parts,
        subTree,
        path,
        part,
        index,
        url,
        debuggeeHostIfRoot,
        source
      );
    }, tree);
  }
docs: /*
  walk the source tree to the final node for a given url,
  adding new nodes along the way