diff options
author | Marcos Casagrande <marcoscvp90@gmail.com> | 2020-04-30 03:36:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-29 21:36:44 -0400 |
commit | 12c6055855af37d00be953080370909d0d7ea9b1 (patch) | |
tree | c00a4d4ee7c2f799df1255b73412827ec09ef5ac /std/node/_fs/_fs_mkdir.ts | |
parent | f92bb9cf4de6ed4b6a84a14775e0dbe4ed45291a (diff) |
Cleanup std/node/fs functions (#5000)
Diffstat (limited to 'std/node/_fs/_fs_mkdir.ts')
-rw-r--r-- | std/node/_fs/_fs_mkdir.ts | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/std/node/_fs/_fs_mkdir.ts b/std/node/_fs/_fs_mkdir.ts index 6e5439a38..fd2156c37 100644 --- a/std/node/_fs/_fs_mkdir.ts +++ b/std/node/_fs/_fs_mkdir.ts @@ -35,12 +35,12 @@ export function mkdir( ); Deno.mkdir(path, { recursive, mode }) .then(() => { - if (callback && typeof callback == "function") { + if (typeof callback === "function") { callback(); } }) .catch((err) => { - if (callback && typeof callback == "function") { + if (typeof callback === "function") { callback(err); } }); @@ -62,9 +62,6 @@ export function mkdirSync(path: Path, options?: MkdirOptions): void { throw new Deno.errors.InvalidData( "invalid recursive option , must be a boolean" ); - try { - Deno.mkdirSync(path, { recursive, mode }); - } catch (err) { - throw err; - } + + Deno.mkdirSync(path, { recursive, mode }); } |