prompt-choices
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -19,4 +19,3 @@ 'use strict'; | ||
function Choices(choices, answers) { | ||
this.answers = answers; | ||
function Choices(choices) { | ||
this.choices = []; | ||
@@ -52,4 +51,4 @@ this.checked = {}; | ||
} else { | ||
choice = new Choice(choice, this.answers); | ||
this.keymap[choice.key] = choice; | ||
choice = new Choice(choice); | ||
this.keymap[choice.key || choice.name] = choice; | ||
} | ||
@@ -56,0 +55,0 @@ // push normalized "choice" object onto array |
@@ -11,3 +11,3 @@ 'use strict'; | ||
function Choice(choice, answers) { | ||
function Choice(choice) { | ||
this.enabled = false; | ||
@@ -34,3 +34,3 @@ | ||
if (typeof choice.disabled === 'function') { | ||
this.disabled = !!choice.disabled.call(this, answers); | ||
this.disabled = !!choice.disabled.call(this); | ||
} else { | ||
@@ -37,0 +37,0 @@ this.disabled = !!choice.disabled; |
{ | ||
"name": "prompt-choices", | ||
"description": "Create an array of multiple choice objects for use in prompts.", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"homepage": "https://github.com/enquirer/prompt-choices", | ||
@@ -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
16764
350