forked from phcode-dev/staging.phcode.dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFileSystemStats.js
More file actions
1 lines (1 loc) · 1.21 KB
/
FileSystemStats.js
File metadata and controls
1 lines (1 loc) · 1.21 KB
1
define(function(require,exports,module){function FileSystemStats(options){var isFile=options.isFile;this._isFile=isFile,this._isDirectory=!isFile,this._mtime=options.mtime instanceof Date?options.mtime:new Date(options.mtime),this._size=options.size,this._hash=options.hash||this._mtime.valueOf();var realPath=options.realPath;realPath&&(isFile||"/"===realPath[realPath.length-1]||(realPath+="/"),this._realPath=realPath)}Object.defineProperties(FileSystemStats.prototype,{isFile:{get:function(){return this._isFile},set:function(){throw new Error("Cannot set isFile")}},isDirectory:{get:function(){return this._isDirectory},set:function(){throw new Error("Cannot set isDirectory")}},mtime:{get:function(){return this._mtime},set:function(){throw new Error("Cannot set mtime")}},size:{get:function(){return this._size},set:function(){throw new Error("Cannot set size")}},realPath:{get:function(){return this._realPath},set:function(){throw new Error("Cannot set realPath")}}}),FileSystemStats.prototype._isFile=!1,FileSystemStats.prototype._isDirectory=!1,FileSystemStats.prototype._mtime=null,FileSystemStats.prototype._size=null,FileSystemStats.prototype._hash=null,FileSystemStats.prototype._realPath=null,module.exports=FileSystemStats});