We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 02ae330 commit 0cbb1b0Copy full SHA for 0cbb1b0
scripts/baekjoon/directory.js
@@ -10,7 +10,15 @@ function convertDirectoryToTree(tree, map){
10
if (map.size == 0) return;
11
12
map.forEach((value, key) => {
13
- const subdir = new Tree(key, 'fa fa fa-inbox', new Array());
+ let array = new Array();
14
+ let icon = 'fa fa-inbox';
15
+ // 마지막 폴더인 경우 nodes를 null로, icon은 archive로 표시
16
+ // 더 이상 들어가지 못하도록
17
+ if(value.size == 0) {
18
+ array = null;
19
+ icon = 'fa fa-archive';
20
+ }
21
+ const subdir = new Tree(key, icon, array);
22
convertDirectoryToTree(subdir, value);
23
tree.nodes.push(subdir);
24
})
0 commit comments