From 1d61ed8dcc7aef758e76511dbc05c7870b4df1a1 Mon Sep 17 00:00:00 2001 From: Simon Boudrias Date: Sat, 27 Jan 2024 16:16:39 -0500 Subject: [PATCH] Bugfix (password): Don't format helpTip as the answer --- packages/password/src/index.mts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/password/src/index.mts b/packages/password/src/index.mts index 138774e7c..77d1734e1 100644 --- a/packages/password/src/index.mts +++ b/packages/password/src/index.mts @@ -51,13 +51,14 @@ export default createPrompt((config, done) => { }); const message = chalk.bold(config.message); - let formattedValue = ''; + let formattedValue = ''; + let helpTip; if (config.mask) { const maskChar = typeof config.mask === 'string' ? config.mask : '*'; formattedValue = maskChar.repeat(value.length); } else if (status !== 'done') { - formattedValue = `${chalk.dim('[input is masked]')}${ansiEscapes.cursorHide}`; + helpTip = `${chalk.dim('[input is masked]')}${ansiEscapes.cursorHide}`; } if (status === 'done') { @@ -69,5 +70,5 @@ export default createPrompt((config, done) => { error = chalk.red(`> ${errorMsg}`); } - return [`${prefix} ${message} ${formattedValue}`, error]; + return [[prefix, message, formattedValue, helpTip].filter(Boolean).join(' '), error]; });