Files

Return to Package Diff Home.
Brought to you by Intrinsic.

Package Diff: inquirer @ 6.2.2 .. 6.3.1

lib/objects/choice.js

@@ -5,7 +5,7 @@
* Choice object
* Normalize input as choice object
* @constructor
- * @param {String|Object} val Choice value. If an object is passed, it should contains
+ * @param {Number|String|Object} val Choice value. If an object is passed, it should contains
* at least one of `value` or `name` property
*/
@@ -16,10 +16,10 @@
return val;
}
- 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 {
_.extend(this, val, {
name: val.name || val.value,

lib/prompts/rawlist.js

@@ -92,7 +92,8 @@
message += chalk.cyan(this.answer);
} else {
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: ';
}

LICENSE

@@ -0,0 +1,22 @@
+Copyright (c) 2012 Simon Boudrias
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file

package.json

@@ -1,6 +1,6 @@
{
"name": "inquirer",
- "version": "6.2.2",
+ "version": "6.3.1",
"description": "A collection of common interactive command line user interfaces.",
"author": "Simon Boudrias <admin@simonboudrias.com>",
"files": [
@@ -48,8 +48,8 @@
"run-async": "^2.2.0",
"rxjs": "^6.4.0",
"string-width": "^2.1.0",
- "strip-ansi": "^5.0.0",
+ "strip-ansi": "^5.1.0",
"through": "^2.3.6"
},
- "gitHead": "ad23da64f321689ff19ba354f4fed7f00acb3fbc"
+ "gitHead": "ee1cc700ad48f10fc304055ec733fb6be6c1d09c"
}

README.md

@@ -113,13 +113,13 @@
<a name="questions"></a>
A question object is a `hash` containing question related values:
-- **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`
- **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.
- **message**: (String|Function) The question to print. If defined as a function, the first parameter will be the current inquirer session answers. Defaults to the value of `name` (followed by a colon).
- **default**: (String|Number|Boolean|Array|Function) Default value(s) to use if nothing is entered, or a function that returns the default value(s). If defined as a function, the first parameter will be the current inquirer session answers.
- **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.
- **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.
- **transformer**: (Function) Receive the user input, answers hash and option flags, and return a transformed value to display to the user. The transformation only impacts what is shown while editing. It does not modify the answers hash.
@@ -165,6 +165,7 @@
- **Value** (Depends on the prompt)
- `confirm`: (Boolean)
- `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)
### Separator
@@ -257,6 +258,12 @@
---
+#### Input - `{type: 'number'}`
+
+Take `type`, `name`, `message`[, `default`, `filter`, `validate`, `transformer`] properties.
+
+---
+
#### Password - `{type: 'password'}`
Take `type`, `name`, `message`, `mask`,[, `default`, `filter`, `validate`] properties.
@@ -410,6 +417,11 @@
<br>
![inquirer-fuzzy-path](https://raw.githubusercontent.com/adelsz/inquirer-fuzzy-path/master/recording.gif)
+[**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>
Prompt for input chalk-pipe style strings<br>
<br>