Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/@npmcli/config/lib/umask.js')
-rw-r--r--deps/npm/node_modules/@npmcli/config/lib/umask.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/deps/npm/node_modules/@npmcli/config/lib/umask.js b/deps/npm/node_modules/@npmcli/config/lib/umask.js
index b445c6fca95..195fad23867 100644
--- a/deps/npm/node_modules/@npmcli/config/lib/umask.js
+++ b/deps/npm/node_modules/@npmcli/config/lib/umask.js
@@ -1,18 +1,21 @@
class Umask {}
const parse = val => {
if (typeof val === 'string') {
- if (/^0o?[0-7]+$/.test(val))
+ if (/^0o?[0-7]+$/.test(val)) {
return parseInt(val.replace(/^0o?/, ''), 8)
- else if (/^[1-9][0-9]*$/.test(val))
+ } else if (/^[1-9][0-9]*$/.test(val)) {
return parseInt(val, 10)
- else
+ } else {
throw new Error(`invalid umask value: ${val}`)
+ }
}
- if (typeof val !== 'number')
+ if (typeof val !== 'number') {
throw new Error(`invalid umask value: ${val}`)
+ }
val = Math.floor(val)
- if (val < 0 || val > 511)
+ if (val < 0 || val > 511) {
throw new Error(`invalid umask value: ${val}`)
+ }
return val
}