mirror of
https://github.com/morluto/rea.git
synced 2026-11-02 21:06:04 +00:00
20 lines
509 B
TypeScript
20 lines
509 B
TypeScript
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)}`,
|
|
);
|
|
}
|
|
}
|
|
};
|