MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / assertOneOf

Method assertOneOf

packages/core/src/app/stateMachine.ts:46–51  ·  view source on GitHub ↗

Assert current state is one of allowed states; throw with detail on violation.

(allowed: readonly AppRuntimeState[], detail: string)

Source from the content-addressed store, hash-verified

44
45 /** Assert current state is one of allowed states; throw with detail on violation. */
46 assertOneOf(allowed: readonly AppRuntimeState[], detail: string): void {
47 for (const s of allowed) {
48 if (this.state0 === s) return;
49 }
50 invalidState(detail);
51 }
52
53 /** Transition to Running; valid from Created or Stopped. */
54 toRunning(): void {

Callers 7

viewFunction · 0.80
drawFunction · 0.80
startFunction · 0.80
runFunction · 0.80
stopFunction · 0.80
printAboveFunction · 0.80
setInlineRowsFunction · 0.80

Calls 1

invalidStateFunction · 0.85

Tested by

no test coverage detected