diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-02-21 10:36:13 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-21 10:36:13 -0500 |
commit | dd8a10948195f231a6a9eb652e3f208813904ad6 (patch) | |
tree | f9a4afeb67bbead882c29c2458a5f1f99e2e42db /std/fs/ensure_dir.ts | |
parent | d9efb8c02a0036d755c35e8e9c88d58bd45a9e2b (diff) |
refactor: remove unneeded ErrorKinds (#3936)
Diffstat (limited to 'std/fs/ensure_dir.ts')
-rw-r--r-- | std/fs/ensure_dir.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/std/fs/ensure_dir.ts b/std/fs/ensure_dir.ts index d4b30dd2d..b6cc3150a 100644 --- a/std/fs/ensure_dir.ts +++ b/std/fs/ensure_dir.ts @@ -1,6 +1,6 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { getFileInfoType } from "./utils.ts"; -const { lstat, lstatSync, mkdir, mkdirSync, ErrorKind } = Deno; +const { lstat, lstatSync, mkdir, mkdirSync } = Deno; /** * Ensures that the directory exists. @@ -16,7 +16,7 @@ export async function ensureDir(dir: string): Promise<void> { ); } } catch (err) { - if (err instanceof Deno.DenoError && err.kind === ErrorKind.NotFound) { + if (err instanceof Deno.Err.NotFound) { // if dir not exists. then create it. await mkdir(dir, { recursive: true }); return; @@ -39,7 +39,7 @@ export function ensureDirSync(dir: string): void { ); } } catch (err) { - if (err instanceof Deno.DenoError && err.kind == ErrorKind.NotFound) { + if (err instanceof Deno.Err.NotFound) { // if dir not exists. then create it. mkdirSync(dir, { recursive: true }); return; |