You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
432 B

4 years ago
  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;