Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Auguste Baum <[email protected]>
  • Loading branch information
rouk1 and augustebaum authored Jul 17, 2024
1 parent cb42ce2 commit f4a4565
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions frontend/src/views/DashboardView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const pathsAsFileTreeNodes = computed(() => {
currentNode = { label: rootSlug };
tree.push(currentNode);
}
// Force the compiler to understand that currentNode can't be undefined at this point
let n = currentNode!;
for (let s of slugs.slice(1)) {
n.children = n.children || [];
Expand Down
4 changes: 2 additions & 2 deletions frontend/tests/components/FileTree.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ function countLeaves(nodes: FileTreeNode[]): number {
return 1;
}

const countInChildren = node.children.map((node) => countInNode(node));
const countInChildren = node.children.map(countInNode);
return countInChildren.reduce((accumulator, leavesCount) => accumulator + leavesCount);
}

const allBranches = nodes.map((node) => countInNode(node));
const allBranches = nodes.map(countInNode);
return allBranches.reduce((accumulator, leavesCount) => accumulator + leavesCount);
}

Expand Down

0 comments on commit f4a4565

Please sign in to comment.