prompt-question
Advanced tools
Comparing version 3.0.0 to 3.0.1
@@ -138,3 +138,4 @@ 'use strict'; | ||
if (this._choices && !this.choices.checked.length && this.default != null) { | ||
this.choices.check(this.default); | ||
this.choices.check(utils.decrement(this.default)); | ||
this.default = null; | ||
} | ||
@@ -141,0 +142,0 @@ if (this._choices && this.choices.length) { |
@@ -46,2 +46,16 @@ 'use strict'; | ||
/** | ||
* Decrement the number on each value in the given array. | ||
*/ | ||
utils.decrement = function(val) { | ||
val = Array.isArray(val) ? val : [val]; | ||
for (var i = 0; i < val.length; i++) { | ||
if (typeof val[i] === 'number') { | ||
val[i] = val[i] - 1; | ||
} | ||
} | ||
return val; | ||
}; | ||
/** | ||
* Return true if `val` is an object | ||
@@ -48,0 +62,0 @@ */ |
{ | ||
"name": "prompt-question", | ||
"description": "Question object, used by Enquirer and prompt plugins.", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"homepage": "https://github.com/enquirer/prompt-question", | ||
@@ -6,0 +6,0 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", |
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
14485
287