Skip to content

Commit 68b6963

Browse files
committed
use switch/case for argument detection
1 parent 0f50468 commit 68b6963

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

json-to-go-v2.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -518,11 +518,13 @@ if (typeof module === 'undefined' || !module.parent) {
518518
}
519519

520520
const argument = val.replace(/-/g, '')
521-
if (argument === "big")
522-
console.warn(`Warning: The argument '${argument}' has been deprecated and has no effect anymore`)
523-
else {
524-
console.error(`Unexpected argument ${val} received`)
525-
process.exit(1)
521+
switch (argument) {
522+
case "big":
523+
console.warn(`Warning: The argument '${argument}' has been deprecated and has no effect anymore`)
524+
break
525+
default:
526+
console.error(`Unexpected argument ${val} received`)
527+
process.exit(1)
526528
}
527529
})
528530

0 commit comments

Comments
 (0)