Comparing version 0.0.0 to 0.1.0
@@ -8,3 +8,4 @@ var QA = require('./'); | ||
"{bold}Additional Thoughts{reset}", | ||
{ key: 'thatsAll', title: "{yellow}{bold}That's all {grey}(yes/no) {yellow}?{reset}", bool: true } | ||
{ title: "{yellow}Favorite {green}Fruits{reset}:", commaList: true }, | ||
{ key: 'thatsAll', title: "{yellow}{bold}That's all {grey}(yes/no) {yellow}?{reset}", bool: true }, | ||
]; | ||
@@ -11,0 +12,0 @@ |
16
index.js
@@ -51,2 +51,6 @@ var read = require("read-cli-input"); | ||
if (question.commaList) { | ||
answer = commaList(answer); | ||
} | ||
callback(answer); | ||
@@ -76,2 +80,14 @@ }); | ||
function commaList (input) { | ||
return input | ||
.trim() | ||
.split(/\s*,\s*/) | ||
.map(function (col) { | ||
return col.trim(); | ||
}) | ||
.filter(function (col) { | ||
return col && col.length; | ||
}); | ||
} | ||
function normalizeQuestion (question) { | ||
@@ -78,0 +94,0 @@ if (typeof question == "string") { |
{ | ||
"name": "cli-qa", | ||
"version": "0.0.0", | ||
"version": "0.1.0", | ||
"description": "Command-line Questions & Answers", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
4507
105