diff options
Diffstat (limited to 'cli/js/file_info.ts')
-rw-r--r-- | cli/js/file_info.ts | 38 |
1 files changed, 14 insertions, 24 deletions
diff --git a/cli/js/file_info.ts b/cli/js/file_info.ts index 827239769..c5b884f75 100644 --- a/cli/js/file_info.ts +++ b/cli/js/file_info.ts @@ -24,8 +24,8 @@ export interface FileInfo { // @internal export class FileInfoImpl implements FileInfo { - private readonly _isFile: boolean; - private readonly _isSymlink: boolean; + readonly #isFile: boolean; + readonly #isSymlink: boolean; size: number; modified: number | null; accessed: number | null; @@ -43,28 +43,18 @@ export class FileInfoImpl implements FileInfo { blocks: number | null; /* @internal */ - constructor(private _res: StatResponse) { + constructor(res: StatResponse) { const isUnix = build.os === "mac" || build.os === "linux"; - const modified = this._res.modified; - const accessed = this._res.accessed; - const created = this._res.created; - const name = this._res.name; + const modified = res.modified; + const accessed = res.accessed; + const created = res.created; + const name = res.name; // Unix only - const { - dev, - ino, - mode, - nlink, - uid, - gid, - rdev, - blksize, - blocks - } = this._res; + const { dev, ino, mode, nlink, uid, gid, rdev, blksize, blocks } = res; - this._isFile = this._res.isFile; - this._isSymlink = this._res.isSymlink; - this.size = this._res.size; + this.#isFile = res.isFile; + this.#isSymlink = res.isSymlink; + this.size = res.size; this.modified = modified ? modified : null; this.accessed = accessed ? accessed : null; this.created = created ? created : null; @@ -82,14 +72,14 @@ export class FileInfoImpl implements FileInfo { } isFile(): boolean { - return this._isFile; + return this.#isFile; } isDirectory(): boolean { - return !this._isFile && !this._isSymlink; + return !this.#isFile && !this.#isSymlink; } isSymlink(): boolean { - return this._isSymlink; + return this.#isSymlink; } } |