mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-06 03:20:13 +08:00
17 lines
326 B
JavaScript
17 lines
326 B
JavaScript
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)
|
|
}
|
|
}
|