Skip to content

Commit 0186e14

Browse files
committed
use switch/case for argument detection
1 parent a3e7457 commit 0186e14

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
@@ -532,11 +532,13 @@ if (typeof module != 'undefined') {
532532
}
533533

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

0 commit comments

Comments
 (0)