Fix: options ref

This commit is contained in:
anseki 2015-03-13 00:59:30 +09:00
parent cf29238c9a
commit 2d29dc0c8a
2 changed files with 5 additions and 5 deletions

View file

@ -296,9 +296,9 @@ exports.setBufferSize = function(newBufSize) {
exports.prompt = function(options) { exports.prompt = function(options) {
var readOptions = { var readOptions = {
display: promptText + '', display: promptText + '',
noEchoBack: options.noEchoBack, noEchoBack: !!(options && options.noEchoBack),
keyIn: false, keyIn: false,
noTrim: options.noTrim noTrim: !!(options && options.noTrim)
}; };
return _readlineSync(readOptions); return _readlineSync(readOptions);
}; };
@ -308,9 +308,9 @@ exports.question = function(query, options) {
/* jshint eqnull:true */ /* jshint eqnull:true */
display: query != null ? query + '' : '', display: query != null ? query + '' : '',
/* jshint eqnull:false */ /* jshint eqnull:false */
noEchoBack: options.noEchoBack, noEchoBack: !!(options && options.noEchoBack),
keyIn: false, keyIn: false,
noTrim: options.noTrim noTrim: !!(options && options.noTrim)
}; };
return _readlineSync(readOptions); return _readlineSync(readOptions);
}; };

View file

@ -1,6 +1,6 @@
{ {
"name": "readline-sync", "name": "readline-sync",
"version": "0.7.6", "version": "0.7.7",
"title": "readlineSync", "title": "readlineSync",
"description": "Synchronous Readline for interactively running to have a conversation with the user via a console(TTY).", "description": "Synchronous Readline for interactively running to have a conversation with the user via a console(TTY).",
"keywords": [ "keywords": [