1
0
Files
sashinexists/node_modules/watcher/dist/watcher_stats.js
2024-12-07 13:18:31 +11:00

30 lines
879 B
JavaScript

/* IMPORT */
/* MAIN */
// An more memory-efficient representation of the useful subset of stats objects
class WatcherStats {
/* CONSTRUCTOR */
constructor(stats) {
this.ino = (stats.ino <= Number.MAX_SAFE_INTEGER) ? Number(stats.ino) : stats.ino;
this.size = Number(stats.size);
this.atimeMs = Number(stats.atimeMs);
this.mtimeMs = Number(stats.mtimeMs);
this.ctimeMs = Number(stats.ctimeMs);
this.birthtimeMs = Number(stats.birthtimeMs);
this._isFile = stats.isFile();
this._isDirectory = stats.isDirectory();
this._isSymbolicLink = stats.isSymbolicLink();
}
/* API */
isFile() {
return this._isFile;
}
isDirectory() {
return this._isDirectory;
}
isSymbolicLink() {
return this._isSymbolicLink;
}
}
/* EXPORT */
export default WatcherStats;