perf(cli): defer command-specific modules until dispatch

This commit is contained in:
morluto
2026-10-11 13:20:15 +08:00
parent 5f4c7ff6df
commit a82d14e4db
10 changed files with 183 additions and 87 deletions
+19
View File
@@ -0,0 +1,19 @@
import type { UpdateResult } from "./Update.js";
/** Whether the update command left the requested release unapplied. */
export const isUpdateFailure = (result: UpdateResult): boolean => {
const status = result.status;
switch (status) {
case "current":
case "updated":
return false;
case "failed":
return true;
default: {
const exhaustive: never = status;
throw new TypeError(
`Unhandled update result status: ${String(exhaustive)}`,
);
}
}
};