Skip to content

Commit

Permalink
fix: the previous release still had a typing bug
Browse files Browse the repository at this point in the history
The previous release did not provide typings that did the correct inferrence if
``inputType`` was not specified.
  • Loading branch information
lddubeau committed May 28, 2019
1 parent c76e2e9 commit 5d17974
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/bootprompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,8 +432,9 @@ export type SelectPromptOptionToValue<T extends { inputType: SelectInputType;
*/
export type PromptOptionsToValue<T extends { inputType?: string;
multiple?: boolean }> =
T extends {} ? string : // This is for when inputType is unset.
T["inputType"] extends (TextualInputType | NumericInputType | TimeInputType |
DateInputType | RadioInputType | never) ? string :
DateInputType | RadioInputType) ? string :
T["inputType"] extends CheckboxInputType ? (string | string[]) :
T extends { inputType: SelectInputType } ? SelectPromptOptionToValue<T> :
never;
Expand Down

0 comments on commit 5d17974

Please sign in to comment.