diff options
| author | Kitson Kelly <me@kitsonkelly.com> | 2020-03-29 04:03:49 +1100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-28 13:03:49 -0400 |
| commit | bced52505f32d6cca4f944bb610a8a26767908a8 (patch) | |
| tree | da49a5df4b7bd6f8306248069228cd6bd0db1303 /cli/js/file_info.ts | |
| parent | 1397b8e0e7c85762e19d88fde103342bfa563360 (diff) | |
Update to Prettier 2 and use ES Private Fields (#4498)
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; } } |
