@supernovaio/cli
Version:
Supernova.io Command Line Interface
32 lines (30 loc) • 1.3 kB
JavaScript
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5d6852c1-e3db-5ce5-8b21-0e04a7264be2")}catch(e){}}();
import { setupStateValues } from "./flow/types.js";
export const setupStateSequence = [...setupStateValues];
export function getNextSetupState(current) {
const currentIndex = setupStateSequence.indexOf(current);
if (currentIndex === -1) {
throw new Error(`Unknown setup state: ${current}`);
}
if (currentIndex === setupStateSequence.length - 1) {
return "DONE";
}
return setupStateSequence[currentIndex + 1];
}
export function getPreviousSetupState(current) {
const currentIndex = setupStateSequence.indexOf(current);
if (currentIndex === -1) {
throw new Error(`Unknown setup state: ${current}`);
}
if (currentIndex === 0) {
return "INIT";
}
return setupStateSequence[currentIndex - 1];
}
export function isValidSetupStateTransition(from, to) {
if (from === to)
return true;
return getNextSetupState(from) === to;
}
//# sourceMappingURL=state.js.map
//# debugId=5d6852c1-e3db-5ce5-8b21-0e04a7264be2