50 lines
856 B
TypeScript
Raw Normal View History

2021-06-28 18:07:02 +08:00
import * as pathUtil from "path";
2021-06-21 16:32:10 +08:00
export default class FileObj {
/**
*
*/
name: string;
2021-06-28 18:07:02 +08:00
/**
*
*/
expandName: string;
/**
*
*/
realName: string;
2021-06-27 21:00:24 +08:00
/**
*
*/
path: string;
2021-06-21 16:32:10 +08:00
/**
*
*/
isFolder: boolean;
2021-06-28 18:07:02 +08:00
/**
*
*/
errorMessage: string;
2021-06-21 16:32:10 +08:00
/**
* ms
*/
createdTime: number;
/**
*
*/
updatedTime: number;
2021-06-28 18:07:02 +08:00
constructor(name: string, path, isFolder, createdTime, updatedTime) {
2021-06-21 16:32:10 +08:00
this.name = name;
2021-06-28 18:07:02 +08:00
this.expandName = pathUtil.extname(name);
if (this.expandName.length > 0) {
this.realName = name.substring(0, name.lastIndexOf("."));
} else {
this.realName = name;
}
2021-06-27 21:00:24 +08:00
this.path = path;
2021-06-21 16:32:10 +08:00
this.isFolder = isFolder;
this.createdTime = createdTime;
this.updatedTime = updatedTime;
}
}