prompt-question
Advanced tools
Comparing version 0.5.1 to 0.5.2
13
index.js
'use strict'; | ||
var debug = require('debug')('prompt-question'); | ||
var koalas = require('koalas'); | ||
var Choices = require('prompt-choices'); | ||
@@ -37,2 +38,3 @@ var utils = require('./lib/utils'); | ||
this.type = 'input'; | ||
utils.define(this, 'Choices', Choices); | ||
@@ -103,3 +105,8 @@ utils.define(this, 'isQuestion', true); | ||
* ```js | ||
* var question = new Question({name: 'first', message: 'First name'?, default: 'Bob'}); | ||
* var question = new Question({ | ||
* name: 'first', | ||
* message: 'First name'?, | ||
* default: 'Bob' | ||
* }); | ||
* | ||
* console.log(question.getAnswer()); | ||
@@ -121,3 +128,3 @@ * //=> 'Bob' | ||
Question.prototype.getAnswer = function(val) { | ||
return (val != null && !!String(val)) ? val : (this.default || ''); | ||
return koalas(val, this.default); | ||
}; | ||
@@ -165,3 +172,3 @@ | ||
get: function() { | ||
return this.default != null && !!String(this.default); | ||
return this.default != null; | ||
} | ||
@@ -168,0 +175,0 @@ }); |
{ | ||
"name": "prompt-question", | ||
"description": "Question object, used by Enquirer and prompt plugins.", | ||
"version": "0.5.1", | ||
"version": "0.5.2", | ||
"homepage": "https://github.com/enquirer/prompt-question", | ||
@@ -29,4 +29,5 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"kind-of": "^3.2.0", | ||
"koalas": "^1.0.2", | ||
"lazy-cache": "^2.0.2", | ||
"prompt-choices": "^0.5.1" | ||
"prompt-choices": "^0.5.2" | ||
}, | ||
@@ -33,0 +34,0 @@ "devDependencies": { |
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
13714
275
8
+ Addedkoalas@^1.0.2
+ Addedkoalas@1.0.2(transitive)
Updatedprompt-choices@^0.5.2