perf(cli): defer command-specific modules until dispatch
This commit is contained in:
@@ -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)}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user