Skip to content

Commit 0cbb1b0

Browse files
committed
UPDATE : 마지막 폴더 아이콘 구분
1 parent 02ae330 commit 0cbb1b0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

scripts/baekjoon/directory.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@ function convertDirectoryToTree(tree, map){
1010
if (map.size == 0) return;
1111

1212
map.forEach((value, key) => {
13-
const subdir = new Tree(key, 'fa fa fa-inbox', new Array());
13+
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);
1422
convertDirectoryToTree(subdir, value);
1523
tree.nodes.push(subdir);
1624
})

0 commit comments

Comments
 (0)