refactor: script assignment using switch statement

This commit is contained in:
Eury Sosa Garcia 2026-01-29 09:01:17 -04:00 committed by GitHub
parent 5f4715acfc
commit f5ae493b75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -102,16 +102,23 @@ if (!runner) {
process.exit(1); process.exit(1);
} }
const script = const script = null
action === "install"
? null switch(action) {
: action === "dev" case "install":
? "dev" script = install
: action === "build" break;
? "build" case "dev":
: action === "test" script = "dev"
? "test" break;
: null; case "build":
script = "build"
break;
case "test":
script = "test"
default:
script = null
}
if (action !== "install" && !script) { if (action !== "install" && !script) {
usage(); usage();