Skip to content

Commit 68abb81

Browse files
committed
Handle validate state for password prompt
1 parent 45b6f29 commit 68abb81

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/prompts/src/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ export const text = (opts: TextOptions) => {
8484

8585
switch (this.state) {
8686
case 'validate':
87-
return `${title}${color.cyan(S_BAR)} ${value}\n${color.cyan(S_BAR_END)} ${color.dim('Validating...')}\n`;
87+
return `${title}${color.cyan(S_BAR)} ${value}\n${color.cyan(S_BAR_END)} ${color.dim(
88+
'Validating...'
89+
)}\n`;
8890
case 'error':
8991
return `${title.trim()}\n${color.yellow(S_BAR)} ${value}\n${color.yellow(
9092
S_BAR_END
@@ -117,6 +119,10 @@ export const password = (opts: PasswordOptions) => {
117119
const masked = this.masked;
118120

119121
switch (this.state) {
122+
case 'validate':
123+
return `${title}${color.cyan(S_BAR)} ${masked}\n${color.cyan(S_BAR_END)} ${color.dim(
124+
'Validating...'
125+
)}\n`;
120126
case 'error':
121127
return `${title.trim()}\n${color.yellow(S_BAR)} ${masked}\n${color.yellow(
122128
S_BAR_END

0 commit comments

Comments
 (0)