MCPcopy
hub / github.com/qawolf/cli / assertHumanMode

Function assertHumanMode

src/shell/ui/renderers/assertHumanMode.ts:3–13  ·  view source on GitHub ↗
(
  mode: OutputMode,
  hint?: string,
)

Source from the content-addressed store, hash-verified

1import type { OutputMode } from "~/shell/ui/env.js";
2
3export function assertHumanMode(
4 mode: OutputMode,
5 hint?: string,
6): asserts mode is "human" {
7 if (mode !== "human") {
8 const message = hint
9 ? `This command requires an interactive terminal. ${hint}`
10 : "This command requires an interactive terminal.";
11 throw Error(message);
12 }
13}

Callers 3

createConfirmFunction · 0.85
createPasswordFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected