summaryrefslogtreecommitdiff
path: root/std/fs/ensure_dir.ts
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2020-04-16 06:40:30 +0100
committerGitHub <noreply@github.com>2020-04-16 01:40:30 -0400
commit5ac728a5f1af575d011c2143f5c9273b0fb4c5bb (patch)
treedfba0fdb3ba17989fd6c3af89ce17a0a71a4df0c /std/fs/ensure_dir.ts
parent6441852a1d5eef0d05ed172a00bef58ad5988842 (diff)
refactor(cli/js/ops/fs): Improve readdir() and FileInfo interfaces (#4763)
Diffstat (limited to 'std/fs/ensure_dir.ts')
-rw-r--r--std/fs/ensure_dir.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/std/fs/ensure_dir.ts b/std/fs/ensure_dir.ts
index a74261c61..ecc7356ef 100644
--- a/std/fs/ensure_dir.ts
+++ b/std/fs/ensure_dir.ts
@@ -10,7 +10,7 @@ const { lstat, lstatSync, mkdir, mkdirSync } = Deno;
export async function ensureDir(dir: string): Promise<void> {
try {
const fileInfo = await lstat(dir);
- if (!fileInfo.isDirectory()) {
+ if (!fileInfo.isDirectory) {
throw new Error(
`Ensure path exists, expected 'dir', got '${getFileInfoType(fileInfo)}'`
);
@@ -33,7 +33,7 @@ export async function ensureDir(dir: string): Promise<void> {
export function ensureDirSync(dir: string): void {
try {
const fileInfo = lstatSync(dir);
- if (!fileInfo.isDirectory()) {
+ if (!fileInfo.isDirectory) {
throw new Error(
`Ensure path exists, expected 'dir', got '${getFileInfoType(fileInfo)}'`
);