-
Notifications
You must be signed in to change notification settings - Fork 10
Add option for (dis)allowing an empty string in prompter #609
Conversation
❤️ |
@@ -66,7 +66,7 @@ export class Prompter implements IPrompter { | |||
return future; | |||
} | |||
|
|||
public getPassword(prompt: string, options?: {allowEmpty?: boolean}): IFuture<string> { | |||
public getPassword(prompt: string, options?: IAllowEmpty): IFuture<string> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we have default action here? Why not using IPrompterOptions
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather not have a default action here because I can't imagine a case where one'd want a default action to take if a password is not provided.
If, on the other hand, we use IPrompterOptions
here and just don't respect the defaultAction
that would be misleading to the coder.
0d33fbb
to
07e8719
Compare
Ping @rosen-vladimirov for a double-chek after fixing the comment |
❤️ |
1 similar comment
❤️ |
if(defaultAction) { | ||
schema.default = defaultAction; | ||
if(options && options.defaultAction) { | ||
schema.default = options.defaultAction; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can remove the if
:
schema.default = options && options.defaultAction;
👍 after considering my comment for default action |
07e8719
to
6c5a141
Compare
❤️ |
Add option for (dis)allowing an empty string in prompter
Implemented to facilitate calls requiring nonempty strings.
Ping @rosen-vladimirov