Comparing version 0.2.3 to 0.2.4
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /*jshint strict:false */ |
@@ -94,2 +94,6 @@ /** | ||
if ( _.isFunction(question.default) ) { | ||
question.default = question.default( this.answers ); | ||
} | ||
if ( _.isFunction(question.choices) ) { | ||
@@ -96,0 +100,0 @@ question.choices = question.choices( this.answers ); |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
{ | ||
"name": "inquirer", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"description": "A collection of common interactive command line user interfaces.", | ||
@@ -5,0 +5,0 @@ "main": "lib/inquirer.js", |
@@ -69,3 +69,3 @@ Inquirer.js [![Build Status](https://travis-ci.org/SBoudrias/Inquirer.js.png?branch=master)](http://travis-ci.org/SBoudrias/Inquirer.js) | ||
+ **message**: (String) The question to print. | ||
+ **default**: (String) Default value to use if nothing is entered | ||
+ **default**: (String|Function) Default value to use if nothing is entered, or a function that returns the default value. 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. | ||
@@ -72,0 +72,0 @@ Array values can be simple `strings`, or `objects` containing a `name` (to display) and a `value` properties (to save in the answers hash). |
@@ -0,0 +0,0 @@ module.exports = { |
@@ -0,0 +0,0 @@ var EventEmitter = require("events").EventEmitter; |
@@ -0,0 +0,0 @@ /** |
@@ -93,2 +93,32 @@ /** | ||
it("should parse `default` if passed as a function", function( done ) { | ||
var stubDefault = "foo"; | ||
inquirer.prompts.stub = function( params ) { | ||
this.opt = { | ||
when: function() { return true; } | ||
}; | ||
expect(params.default).to.equal(stubDefault); | ||
done(); | ||
}; | ||
inquirer.prompts.stub.prototype.run = function() {}; | ||
var prompts = [{ | ||
type: "input", | ||
name: "name1", | ||
message: "message", | ||
default: "bar" | ||
}, { | ||
type: "stub", | ||
name: "name", | ||
message: "message", | ||
default: function( answers ) { | ||
expect(answers.name1).to.equal("bar"); | ||
return stubDefault; | ||
} | ||
}]; | ||
inquirer.prompt(prompts, function() {}); | ||
inquirer.rl.emit("line"); | ||
}); | ||
it("should parse `choices` if passed as a function", function( done ) { | ||
@@ -95,0 +125,0 @@ var stubChoices = [ "foo", "bar" ]; |
@@ -0,0 +0,0 @@ var expect = require("chai").expect; |
@@ -0,0 +0,0 @@ var expect = require("chai").expect; |
@@ -0,0 +0,0 @@ var expect = require("chai").expect; |
@@ -0,0 +0,0 @@ var expect = require("chai").expect; |
@@ -0,0 +0,0 @@ var expect = require("chai").expect; |
@@ -0,0 +0,0 @@ var expect = require("chai").expect; |
@@ -0,0 +0,0 @@ var expect = require("chai").expect; |
@@ -0,0 +0,0 @@ var expect = require("chai").expect; |
@@ -0,0 +0,0 @@ var expect = require("chai").expect; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
112957
41
2596