[improve] Add falsy type to skip the question

This commit is contained in:
Kamontat Chantrachirathumrong
2018-11-24 16:06:46 +01:00
committed by GitHub
parent a2c196471f
commit 218607fa1b
+3 -1
View File
@@ -57,7 +57,7 @@ declare namespace prompts {
}
interface PromptObject<T extends string = string> {
type: ValueOrFunc<string>;
type: ValueOrFunc<string> | Falsy;
name: ValueOrFunc<T>;
message?: ValueOrFunc<string>;
initial?: string | number | boolean;
@@ -86,6 +86,8 @@ declare namespace prompts {
values: Answers<T>,
prompt: PromptObject
) => R;
type Falsy = false | null | undefined;
type ValueOrFunc<T extends string> = T | PrevCaller<T>;
}