Skip to content

Commit

Permalink
Handle validate state for password prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
ulken committed Mar 5, 2023
1 parent a40b6a3 commit d3616a1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/prompts/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ export const text = (opts: TextOptions) => {

switch (this.state) {
case 'validate':
return `${title}${color.cyan(S_BAR)} ${value}\n${color.cyan(S_BAR_END)} ${color.dim('Validating...')}\n`;
return `${title}${color.cyan(S_BAR)} ${value}\n${color.cyan(S_BAR_END)} ${color.dim(
'Validating...'
)}\n`;
case 'error':
return `${title.trim()}\n${color.yellow(S_BAR)} ${value}\n${color.yellow(
S_BAR_END
Expand Down Expand Up @@ -117,6 +119,10 @@ export const password = (opts: PasswordOptions) => {
const masked = this.masked;

switch (this.state) {
case 'validate':
return `${title}${color.cyan(S_BAR)} ${masked}\n${color.cyan(S_BAR_END)} ${color.dim(
'Validating...'
)}\n`;
case 'error':
return `${title.trim()}\n${color.yellow(S_BAR)} ${masked}\n${color.yellow(
S_BAR_END
Expand Down

0 comments on commit d3616a1

Please sign in to comment.