Skip to content

Commit 832021c

Browse files
committed
use switch/case for argument detection
1 parent 55ea1f2 commit 832021c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

json-to-go.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -533,11 +533,13 @@ if (typeof module != 'undefined') {
533533
}
534534

535535
const argument = val.replace(/-/g, '')
536-
if (argument === "big")
537-
console.warn(`Warning: The argument '${argument}' has been deprecated and has no effect anymore`)
538-
else {
539-
console.error(`Unexpected argument ${val} received`)
540-
process.exit(1)
536+
switch (argument) {
537+
case "big":
538+
console.warn(`Warning: The argument '${argument}' has been deprecated and has no effect anymore`)
539+
break
540+
default:
541+
console.error(`Unexpected argument ${val} received`)
542+
process.exit(1)
541543
}
542544
})
543545

0 commit comments

Comments
 (0)