summaryrefslogtreecommitdiff
path: root/std/node/_fs/_fs_chmod.ts
diff options
context:
space:
mode:
authorMarcos Casagrande <marcoscvp90@gmail.com>2020-04-30 03:36:44 +0200
committerGitHub <noreply@github.com>2020-04-29 21:36:44 -0400
commit12c6055855af37d00be953080370909d0d7ea9b1 (patch)
treec00a4d4ee7c2f799df1255b73412827ec09ef5ac /std/node/_fs/_fs_chmod.ts
parentf92bb9cf4de6ed4b6a84a14775e0dbe4ed45291a (diff)
Cleanup std/node/fs functions (#5000)
Diffstat (limited to 'std/node/_fs/_fs_chmod.ts')
-rw-r--r--std/node/_fs/_fs_chmod.ts6
1 files changed, 2 insertions, 4 deletions
diff --git a/std/node/_fs/_fs_chmod.ts b/std/node/_fs/_fs_chmod.ts
index 306113047..2adff59ff 100644
--- a/std/node/_fs/_fs_chmod.ts
+++ b/std/node/_fs/_fs_chmod.ts
@@ -31,10 +31,8 @@ function getResolvedMode(mode: string | number): number {
return mode;
}
- if (typeof mode === "string") {
- if (!allowedModes.test(mode)) {
- throw new Error("Unrecognized mode: " + mode);
- }
+ if (typeof mode === "string" && !allowedModes.test(mode)) {
+ throw new Error("Unrecognized mode: " + mode);
}
return parseInt(mode, 8);