Socket
Socket
Sign inDemoInstall

inquirer

Package Overview
Dependencies
Maintainers
1
Versions
176
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inquirer - npm Package Compare versions

Comparing version 0.8.2 to 0.8.3

3

lib/objects/choices.js

@@ -28,2 +28,5 @@ /**

if ( val.type === "separator" ) {
if(!(val instanceof Separator)){
val = new Separator(val.line);
}
return val;

@@ -30,0 +33,0 @@ }

19

lib/ui/prompt.js

@@ -114,12 +114,21 @@ /**

PromptUI.prototype.filterIfRunnable = function( question ) {
if ( !_.isFunction(question.when) ) return rx.Observable.return(question);
if ( question.when == null ) return rx.Observable.return(question);
var handleResult = function( obs, shouldRun ) {
if ( shouldRun ) {
obs.onNext( question );
}
obs.onCompleted();
};
var answers = this.answers;
return rx.Observable.defer(function() {
return rx.Observable.create(function( obs ) {
if ( _.isBoolean(question.when) ) {
handleResult( obs, question.when );
return;
}
utils.runAsync( question.when, function( shouldRun ) {
if ( shouldRun ) {
obs.onNext( question );
}
obs.onCompleted();
handleResult( obs, shouldRun );
}, answers );

@@ -126,0 +135,0 @@ });

{
"name": "inquirer",
"version": "0.8.2",
"version": "0.8.3",
"description": "A collection of common interactive command line user interfaces.",

@@ -5,0 +5,0 @@ "main": "lib/inquirer.js",

@@ -68,3 +68,3 @@ Inquirer.js

- **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.
- **when**: (Function) Receive the current user answers hash and should return `true` or `false` depending on whether or not this question should be asked.
- **when**: (Function, Boolean) Receive the current user answers hash and should return `true` or `false` depending on whether or not this question should be asked. The value can also be a simple boolean.

@@ -71,0 +71,0 @@ `default`(if defined as a function), `validate`, `filter` and `when` functions can be called asynchronously using `this.async()`. You just have to pass the value you'd normally return to the callback option.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc