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
18 lines
432 B
'use strict';
|
|
|
|
const StringPrompt = require('../types/string');
|
|
|
|
class PasswordPrompt extends StringPrompt {
|
|
constructor(options) {
|
|
super(options);
|
|
this.cursorShow();
|
|
}
|
|
|
|
format(input = this.input) {
|
|
if (!this.keypressed) return '';
|
|
let color = this.state.submitted ? this.styles.primary : this.styles.muted;
|
|
return color(this.symbols.asterisk.repeat(input.length));
|
|
}
|
|
}
|
|
|
|
module.exports = PasswordPrompt;
|