diff --git a/lib/readline-sync.js b/lib/readline-sync.js index 049cedb..9222eff 100644 --- a/lib/readline-sync.js +++ b/lib/readline-sync.js @@ -296,9 +296,9 @@ exports.setBufferSize = function(newBufSize) { exports.prompt = function(options) { var readOptions = { display: promptText + '', - noEchoBack: options.noEchoBack, + noEchoBack: !!(options && options.noEchoBack), keyIn: false, - noTrim: options.noTrim + noTrim: !!(options && options.noTrim) }; return _readlineSync(readOptions); }; @@ -308,9 +308,9 @@ exports.question = function(query, options) { /* jshint eqnull:true */ display: query != null ? query + '' : '', /* jshint eqnull:false */ - noEchoBack: options.noEchoBack, + noEchoBack: !!(options && options.noEchoBack), keyIn: false, - noTrim: options.noTrim + noTrim: !!(options && options.noTrim) }; return _readlineSync(readOptions); }; diff --git a/package.json b/package.json index 2d539c9..9144260 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "readline-sync", - "version": "0.7.6", + "version": "0.7.7", "title": "readlineSync", "description": "Synchronous Readline for interactively running to have a conversation with the user via a console(TTY).", "keywords": [