26ad275a17443c376071d1ed693453e810a347edb463d75fb97166cc3666c7cf522ce37bd99a888f27bd876f80e405ebcde878d509049b951f5fed4b1be2e3 432 B

123456789101112131415161718
  1. 'use strict';
  2. const StringPrompt = require('../types/string');
  3. class PasswordPrompt extends StringPrompt {
  4. constructor(options) {
  5. super(options);
  6. this.cursorShow();
  7. }
  8. format(input = this.input) {
  9. if (!this.keypressed) return '';
  10. let color = this.state.submitted ? this.styles.primary : this.styles.muted;
  11. return color(this.symbols.asterisk.repeat(input.length));
  12. }
  13. }
  14. module.exports = PasswordPrompt;