From 2d29dc0c8af139c6c336ab23f1947f3eba8e9a6c Mon Sep 17 00:00:00 2001 From: anseki Date: Fri, 13 Mar 2015 00:59:30 +0900 Subject: [PATCH] Fix: options ref --- lib/readline-sync.js | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) 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": [