Skip to content

Commit

Permalink
fix: avoid undefined key in win32 terminal
Browse files Browse the repository at this point in the history
closes #10
  • Loading branch information
3cp committed Aug 11, 2020
1 parent 33c4181 commit 0d5e48e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/prompts/prompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ module.exports = class Prompt extends EventEmitter {
const keypress = (str, key) => {
let a = action(key);
if (a === false) {
this._ && this._(str, key);
if (typeof str === 'string') {
this._ && this._(str, key);
}
} else if (typeof this[a] === 'function') {
this[a](key);
} else {
Expand Down

0 comments on commit 0d5e48e

Please sign in to comment.