feat: create FileNode class, addChild method

This commit is contained in:
wancat committed 2023-08-21 22:22:01 +08:00
1 parent fcaa088a31
commit 9b78f0d41c
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)
}
}