Comparing version 2.0.0 to 2.0.1
@@ -21,4 +21,4 @@ "use strict"; | ||
if (inputStream === process.stdin) | ||
console.log('Unexpected answer. %d retries left.', tries - 1); | ||
if (tries === 0) { | ||
console.log('Unexpected answer. %d retries left.', tries); | ||
if (!tries) { | ||
inputStream.removeListener('data', listener); | ||
@@ -35,3 +35,3 @@ inputStream.pause(); | ||
const inputStream = getInputStream(config); | ||
const tries = config.maxRetries || DEFAULT_MAX_RETRIES; | ||
let tries = config.maxRetries || DEFAULT_MAX_RETRIES; | ||
const onError = getOnError(question, config, callback); | ||
@@ -41,3 +41,3 @@ function listener(data) { | ||
if (config.options && !config.options.includes(answer)) | ||
return onError(listener, tries - 1); | ||
return onError(listener, --tries); | ||
inputStream.removeListener('data', listener); | ||
@@ -44,0 +44,0 @@ inputStream.pause(); |
{ | ||
"name": "stdio", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Standard input/output manager for Node.js", | ||
@@ -5,0 +5,0 @@ "files": [ |
@@ -13,3 +13,3 @@ ![logo](https://user-images.githubusercontent.com/675812/61961326-88346a80-afc7-11e9-9853-f4ef66ce686c.png) | ||
**Note**: Version 2 stops supporting non promise-based usage, so it is not compatible with older versions. If you're using an older version of `stdio` please, read this documentation carefully before upgrading. | ||
**Note**: Version 2 stops supporting non promise-based usage. Some functions have been renamed, too. So it is not compatible with older versions. If you're using an older version of `stdio` please, read this documentation carefully before upgrading. | ||
@@ -16,0 +16,0 @@ Table of contents: |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
33943
0