inquirerer 2.0.5 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/prompt.js +10 -7
- package/package.json +2 -2
- package/prompt.js +10 -7
- package/question/types.d.ts +2 -0
package/esm/prompt.js
CHANGED
|
@@ -445,13 +445,16 @@ export class Inquirerer {
|
|
|
445
445
|
: result.filter(opt => opt.selected);
|
|
446
446
|
}
|
|
447
447
|
handleOverridesWithOptions(argv, obj, question) {
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
448
|
+
const input = argv[question.name];
|
|
449
|
+
if (typeof input !== 'string')
|
|
450
|
+
return;
|
|
451
|
+
const options = this.sanitizeOptions(question);
|
|
452
|
+
const found = options.find(opt => opt.name === input || String(opt.value) === input);
|
|
453
|
+
if (found) {
|
|
454
|
+
obj[question.name] = found.value;
|
|
455
|
+
}
|
|
456
|
+
else if (question.allowCustomOptions) {
|
|
457
|
+
obj[question.name] = input; // Store as-is
|
|
455
458
|
}
|
|
456
459
|
}
|
|
457
460
|
async handleQuestionType(question, ctx) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "inquirerer",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.6",
|
|
4
4
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
|
5
5
|
"description": "inquirerer",
|
|
6
6
|
"main": "index.js",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"minimist": "^1.2.8"
|
|
36
36
|
},
|
|
37
37
|
"keywords": [],
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "e3b1d18ba6929731f2c662d451732307ec28ae75"
|
|
39
39
|
}
|
package/prompt.js
CHANGED
|
@@ -451,13 +451,16 @@ class Inquirerer {
|
|
|
451
451
|
: result.filter(opt => opt.selected);
|
|
452
452
|
}
|
|
453
453
|
handleOverridesWithOptions(argv, obj, question) {
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
454
|
+
const input = argv[question.name];
|
|
455
|
+
if (typeof input !== 'string')
|
|
456
|
+
return;
|
|
457
|
+
const options = this.sanitizeOptions(question);
|
|
458
|
+
const found = options.find(opt => opt.name === input || String(opt.value) === input);
|
|
459
|
+
if (found) {
|
|
460
|
+
obj[question.name] = found.value;
|
|
461
|
+
}
|
|
462
|
+
else if (question.allowCustomOptions) {
|
|
463
|
+
obj[question.name] = input; // Store as-is
|
|
461
464
|
}
|
|
462
465
|
}
|
|
463
466
|
async handleQuestionType(question, ctx) {
|
package/question/types.d.ts
CHANGED
|
@@ -32,11 +32,13 @@ export interface AutocompleteQuestion extends BaseQuestion {
|
|
|
32
32
|
type: 'autocomplete';
|
|
33
33
|
options: (string | OptionValue)[];
|
|
34
34
|
maxDisplayLines?: number;
|
|
35
|
+
allowCustomOptions?: boolean;
|
|
35
36
|
}
|
|
36
37
|
export interface ListQuestion extends BaseQuestion {
|
|
37
38
|
type: 'list';
|
|
38
39
|
options: (string | OptionValue)[];
|
|
39
40
|
maxDisplayLines?: number;
|
|
41
|
+
allowCustomOptions?: boolean;
|
|
40
42
|
}
|
|
41
43
|
export interface CheckboxQuestion extends BaseQuestion {
|
|
42
44
|
type: 'checkbox';
|