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

Function askQuestion

packages/angular/cli/src/utilities/prompt.ts:32–53  ·  view source on GitHub ↗
(
  message: string,
  choices: { name: string; value: string | null }[],
  defaultResponseIndex: number,
  noTTYResponse: null | string,
)

Source from the content-addressed store, hash-verified

30}
31
32export async function askQuestion(
33 message: string,
34 choices: { name: string; value: string | null }[],
35 defaultResponseIndex: number,
36 noTTYResponse: null | string,
37): Promise<string | null> {
38 if (!isTTY()) {
39 return noTTYResponse;
40 }
41
42 const { select } = await import('@inquirer/prompts');
43 const answer = await select({
44 message,
45 choices,
46 default: choices[defaultResponseIndex].value,
47 theme: {
48 prefix: '',
49 },
50 });
51
52 return answer;
53}
54
55export async function askChoices(
56 message: string,

Callers 1

Calls 1

isTTYFunction · 0.90

Tested by

no test coverage detected