summaryrefslogtreecommitdiff
path: root/cli/js/file_info.ts
diff options
context:
space:
mode:
authordubiousjim <dubiousjim@gmail.com>2020-03-31 13:46:25 -0400
committerGitHub <noreply@github.com>2020-03-31 13:46:25 -0400
commitd4d0b5d90c8abc5867a389129ee185b2c1cf0f0f (patch)
treed2cd0f05cfc2e8e9b2c5d897d8dc2402bc53daea /cli/js/file_info.ts
parenta86b07f2df20b6436291d77d9636061ede0b6c8e (diff)
Properly track isFile, isSymlink, isDirectory (#4541)
* Properly track isFile, isSymlink, isDirectory These don't exhaust all the possibilities, so none of them should be defined as "neither of the others". * empty
Diffstat (limited to 'cli/js/file_info.ts')
-rw-r--r--cli/js/file_info.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/cli/js/file_info.ts b/cli/js/file_info.ts
index c5b884f75..27df0bbb7 100644
--- a/cli/js/file_info.ts
+++ b/cli/js/file_info.ts
@@ -25,6 +25,7 @@ export interface FileInfo {
// @internal
export class FileInfoImpl implements FileInfo {
readonly #isFile: boolean;
+ readonly #isDirectory: boolean;
readonly #isSymlink: boolean;
size: number;
modified: number | null;
@@ -53,6 +54,7 @@ export class FileInfoImpl implements FileInfo {
const { dev, ino, mode, nlink, uid, gid, rdev, blksize, blocks } = res;
this.#isFile = res.isFile;
+ this.#isDirectory = res.isDirectory;
this.#isSymlink = res.isSymlink;
this.size = res.size;
this.modified = modified ? modified : null;
@@ -76,7 +78,7 @@ export class FileInfoImpl implements FileInfo {
}
isDirectory(): boolean {
- return !this.#isFile && !this.#isSymlink;
+ return this.#isDirectory;
}
isSymlink(): boolean {