feat: create FileNode class, addChild method

This commit is contained in:
wancat authored and Chen, Tai-Lin committed 2023-08-28 14:39:52 +08:00
1 parent bdb979e608
commit fa496ceae7
4 files changed
+131

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
export default class File {
constructor({ path, name, type, discovered }) {
this.path = path
this.name = name
this.type = type
this.discovered = discovered
}
isDirectory() {
return this.type === 'folder'
}
contains(file) {
return this.isDirectory() && file.path.startsWith(this.path)
}
}