@@ -5,7 +5,6 @@ import inquirer from 'inquirer';
5
5
import InputPrompt from 'inquirer/lib/prompts/input' ;
6
6
import observe from 'inquirer/lib/utils/events' ;
7
7
8
- import SuccessfulPromptStateData = inquirer . prompts . SuccessfulPromptStateData ;
9
8
import Answers = inquirer . Answers ;
10
9
import InputCustomOptions = inquirer . InputCustomOptions ;
11
10
import Validator = inquirer . Validator ;
@@ -44,17 +43,9 @@ export default class InputCustomPrompt<
44
43
if ( input . length > this . opt . maxLength ( answers ) ) {
45
44
return 'Input contains too many characters!' ;
46
45
}
47
- if ( input . length === 0 ) {
48
- if ( ! this . opt . required ) {
49
- return chalk . blue (
50
- `ℹ Enter ${ chalk . bold ( ':skip' ) } to omit ${ chalk . bold (
51
- this . opt . name
52
- ) } .`
53
- ) ;
54
- } else {
55
- // Show help if enum is defined and input may not be empty
56
- return `⚠ ${ chalk . bold ( this . opt . name ) } may not be empty.` ;
57
- }
46
+ if ( input . length === 0 && this . opt . required ) {
47
+ // Show help if enum is defined and input may not be empty
48
+ return `⚠ ${ chalk . bold ( this . opt . name ) } may not be empty.` ;
58
49
}
59
50
60
51
if ( validate ) {
@@ -75,15 +66,6 @@ export default class InputCustomPrompt<
75
66
// process.exit(1)
76
67
}
77
68
78
- onEnd ( eventArgs : SuccessfulPromptStateData ) : void {
79
- if ( ! this . opt . required ) {
80
- if ( eventArgs . value === ':skip' ) {
81
- eventArgs . value = '' ;
82
- }
83
- }
84
- super . onEnd ( eventArgs ) ;
85
- }
86
-
87
69
measureInput ( input : string ) : number {
88
70
if ( this . opt . filter ) {
89
71
return this . opt . filter ( input , this . answers ) . length ;
0 commit comments