MCPcopy Index your code
hub / github.com/angular/angular-cli / askConfirmation

Function askConfirmation

packages/angular/cli/src/utilities/prompt.ts:11–30  ·  view source on GitHub ↗
(
  message: string,
  defaultResponse: boolean,
  noTTYResponse?: boolean,
)

Source from the content-addressed store, hash-verified

9import { isTTY } from './tty';
10
11export async function askConfirmation(
12 message: string,
13 defaultResponse: boolean,
14 noTTYResponse?: boolean,
15): Promise<boolean> {
16 if (!isTTY()) {
17 return noTTYResponse ?? defaultResponse;
18 }
19
20 const { confirm } = await import('@inquirer/prompts');
21 const answer = await confirm({
22 message,
23 default: defaultResponse,
24 theme: {
25 prefix: '',
26 },
27 });
28
29 return answer;
30}
31
32export async function askQuestion(
33 message: string,

Callers 3

promptForAutocompletionFunction · 0.90
promptAnalyticsFunction · 0.90

Calls 1

isTTYFunction · 0.90

Tested by

no test coverage detected