var Choices = require('{%= name %}');
var choices = new Choices(['foo', 'bar', 'baz']);
{%= apidocs("index.js") %}
Added
- adds array support to
.isChecked
Fixed
- ensures that choice groups are checked/unchecked based on group items
Added
- adds support for choice "groups"! This allows you to define an object of choice arrays, where each key in the object creates a choice group.
Changed
- renamed
Move
class toActions
- renamed
choices.move
property tochoices.actions
Removed
- removed
.enable
and.disable
prototype methods from bothChoice
andChoices
. These methods were ambiguous as they blurred the distinction between "enabling" a choice (meaning that it's "checked") versus enabling a property on a choice. If this is confusing, that's why they were removed.
Added
- adds
Actions
class (previously namedMove
) for managing actions on choices - adds
.addChoice
prototype method, for adding a single choice after instantiation - adds
.action
prototype method toChoices
, which calls a method on theActions
class - adds
.check
and.uncheck
prototype methods (previously ambiguously named.enable
and.disable
)
Some of the code in this library was initially based on the Choices
class in Inquirer.