MCPcopy Create free account
hub / github.com/dataform-co/dataform / intQuestion

Function intQuestion

cli/console.ts:118–131  ·  view source on GitHub ↗
(questionText: string, defaultValue?: number)

Source from the content-addressed store, hash-verified

116}
117
118export function intQuestion(questionText: string, defaultValue?: number) {
119 return parseInt(
120 prompt(questionText, {
121 limit: value => {
122 const intValue = parseInt(value, 10);
123 return !isNaN(intValue);
124 },
125 limitMessage: errorOutput("Entered value must be an integer."),
126 prompt: `[${defaultValue}] `,
127 defaultInput: `${defaultValue}`
128 }),
129 10
130 );
131}
132
133export function selectionQuestion(questionText: string, options: string[]) {
134 return readlineSync.keyInSelect(options, `${questionText}\n`, {

Callers

nothing calls this directly

Calls 2

promptFunction · 0.85
errorOutputFunction · 0.85

Tested by

no test coverage detected