Updating NPM dependencies
This commit is contained in:
6
node_modules/prompts/lib/index.js
generated
vendored
6
node_modules/prompts/lib/index.js
generated
vendored
@@ -65,7 +65,7 @@ async function prompt(questions=[], { onSubmit=noop, onCancel=noop }={}) {
|
||||
|
||||
try {
|
||||
// Get the injected answer if there is one or prompt the user
|
||||
answer = prompt._injected ? getInjectedAnswer(prompt._injected) : await prompts[type](question);
|
||||
answer = prompt._injected ? getInjectedAnswer(prompt._injected, question.initial) : await prompts[type](question);
|
||||
answers[name] = answer = await getFormattedAnswer(question, answer, true);
|
||||
quit = await onSubmit(question, answer, answers);
|
||||
} catch (err) {
|
||||
@@ -78,13 +78,13 @@ async function prompt(questions=[], { onSubmit=noop, onCancel=noop }={}) {
|
||||
return answers;
|
||||
}
|
||||
|
||||
function getInjectedAnswer(injected) {
|
||||
function getInjectedAnswer(injected, deafultValue) {
|
||||
const answer = injected.shift();
|
||||
if (answer instanceof Error) {
|
||||
throw answer;
|
||||
}
|
||||
|
||||
return answer;
|
||||
return (answer === undefined) ? deafultValue : answer;
|
||||
}
|
||||
|
||||
function inject(answers) {
|
||||
|
||||
Reference in New Issue
Block a user