(msg = otpPrompt, otp, isRetry)
| 16 | input.read(() => _read(options), { [META]: true, silent: options?.silent }) |
| 17 | |
| 18 | function readOTP (msg = otpPrompt, otp, isRetry) { |
| 19 | if (isRetry && otp && /^[\d ]+$|^[A-Fa-f0-9]{64,64}$/.test(otp)) { |
| 20 | return otp.replace(/\s+/g, '') |
| 21 | } |
| 22 | |
| 23 | return read({ prompt: msg, default: otp || '' }) |
| 24 | .then((rOtp) => readOTP(msg, rOtp, true)) |
| 25 | } |
| 26 | |
| 27 | function readPassword (msg = passwordPrompt, password, isRetry) { |
| 28 | if (isRetry && password) { |