diff options
author | Nayeem Rahman <nayeemrmn99@gmail.com> | 2020-06-12 20:23:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-12 15:23:38 -0400 |
commit | 1fff6f55c3ba98a10018c6d374795e612061e9b6 (patch) | |
tree | 12074b6d44736b11513d857e437f9e30a6bf65a4 /std/fs/exists.ts | |
parent | 26bf56afdaf16634ffbaa23684faf3a44cc10f62 (diff) |
refactor: Don't destructure the Deno namespace (#6268)
Diffstat (limited to 'std/fs/exists.ts')
-rw-r--r-- | std/fs/exists.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/std/fs/exists.ts b/std/fs/exists.ts index f9e5a0925..a79455b2d 100644 --- a/std/fs/exists.ts +++ b/std/fs/exists.ts @@ -1,11 +1,10 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -const { lstat, lstatSync } = Deno; /** * Test whether or not the given path exists by checking with the file system */ export async function exists(filePath: string): Promise<boolean> { try { - await lstat(filePath); + await Deno.lstat(filePath); return true; } catch (err) { if (err instanceof Deno.errors.NotFound) { @@ -21,7 +20,7 @@ export async function exists(filePath: string): Promise<boolean> { */ export function existsSync(filePath: string): boolean { try { - lstatSync(filePath); + Deno.lstatSync(filePath); return true; } catch (err) { if (err instanceof Deno.errors.NotFound) { |