mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 03:20:12 +08:00
feat: create FileNode class, addChild method
This commit is contained in:
1 parent
bdb979e608
commit
fa496ceae7
4 files changed
+131
No files matched your search
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user