summaryrefslogtreecommitdiff
path: root/std/node/_fs/_fs_chmod.ts
diff options
context:
space:
mode:
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);