Comparing version 6.2.2 to 6.3.1
@@ -8,4 +8,4 @@ 'use strict'; | ||
* @constructor | ||
* @param {String|Object} val Choice value. If an object is passed, it should contains | ||
* at least one of `value` or `name` property | ||
* @param {Number|String|Object} val Choice value. If an object is passed, it should contains | ||
* at least one of `value` or `name` property | ||
*/ | ||
@@ -20,6 +20,6 @@ | ||
if (_.isString(val)) { | ||
this.name = val; | ||
if (_.isString(val) || _.isNumber(val)) { | ||
this.name = String(val); | ||
this.value = val; | ||
this.short = val; | ||
this.short = String(val); | ||
} else { | ||
@@ -26,0 +26,0 @@ _.extend(this, val, { |
@@ -95,3 +95,4 @@ 'use strict'; | ||
var choicesStr = renderChoices(this.opt.choices, this.selected); | ||
message += this.paginator.paginate(choicesStr, this.selected, this.opt.pageSize); | ||
message += | ||
'\n' + this.paginator.paginate(choicesStr, this.selected, this.opt.pageSize); | ||
message += '\n Answer: '; | ||
@@ -98,0 +99,0 @@ } |
{ | ||
"name": "inquirer", | ||
"version": "6.2.2", | ||
"version": "6.3.1", | ||
"description": "A collection of common interactive command line user interfaces.", | ||
@@ -51,6 +51,6 @@ "author": "Simon Boudrias <admin@simonboudrias.com>", | ||
"string-width": "^2.1.0", | ||
"strip-ansi": "^5.0.0", | ||
"strip-ansi": "^5.1.0", | ||
"through": "^2.3.6" | ||
}, | ||
"gitHead": "ad23da64f321689ff19ba354f4fed7f00acb3fbc" | ||
"gitHead": "ee1cc700ad48f10fc304055ec733fb6be6c1d09c" | ||
} |
@@ -116,3 +116,3 @@ <img width="75px" height="75px" align="right" alt="Inquirer Logo" src="https://raw.githubusercontent.com/SBoudrias/Inquirer.js/master/assets/inquirer_readme.svg?sanitize=true" title="Inquirer.js"/> | ||
- **type**: (String) Type of the prompt. Defaults: `input` - Possible values: `input`, `confirm`, | ||
- **type**: (String) Type of the prompt. Defaults: `input` - Possible values: `input`, `number`, `confirm`, | ||
`list`, `rawlist`, `expand`, `checkbox`, `password`, `editor` | ||
@@ -123,3 +123,3 @@ - **name**: (String) The name to use when storing the answer in the answers hash. If the name contains periods, it will define a path in the answers hash. | ||
- **choices**: (Array|Function) Choices array or a function returning a choices array. If defined as a function, the first parameter will be the current inquirer session answers. | ||
Array values can be simple `strings`, or `objects` containing a `name` (to display in list), a `value` (to save in the answers hash) and a `short` (to display after selection) properties. The choices array can also contain [a `Separator`](#separator). | ||
Array values can be simple `numbers`, `strings`, or `objects` containing a `name` (to display in list), a `value` (to save in the answers hash) and a `short` (to display after selection) properties. The choices array can also contain [a `Separator`](#separator). | ||
- **validate**: (Function) Receive the user input and answers hash. Should return `true` if the value is valid, and an error message (`String`) otherwise. If `false` is returned, a default error message is provided. | ||
@@ -170,2 +170,3 @@ - **filter**: (Function) Receive the user input and return the filtered value to be used inside the program. The value returned will be added to the _Answers_ hash. | ||
- `input` : User input (filtered if `filter` is defined) (String) | ||
- `number`: User input (filtered if `filter` is defined) (Number) | ||
- `rawlist`, `list` : Selected choice value (or name if no value specified) (String) | ||
@@ -263,2 +264,8 @@ | ||
#### Input - `{type: 'number'}` | ||
Take `type`, `name`, `message`[, `default`, `filter`, `validate`, `transformer`] properties. | ||
--- | ||
#### Password - `{type: 'password'}` | ||
@@ -417,2 +424,7 @@ | ||
[**inquirer-emoji**](https://github.com/tannerntannern/inquirer-emoji)<br> | ||
Prompt for inputting emojis.<br> | ||
<br> | ||
![inquirer-emoji](https://github.com/tannerntannern/inquirer-emoji/raw/master/demo.gif) | ||
[**inquirer-chalk-pipe**](https://github.com/LitoMore/inquirer-chalk-pipe)<br> | ||
@@ -419,0 +431,0 @@ Prompt for input chalk-pipe style strings<br> |
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
77174
25
1969
445
Updatedstrip-ansi@^5.1.0