Skip to content

Commit

Permalink
Merge pull request #387 from sparksuite/fix-option-types
Browse files Browse the repository at this point in the history
Fix generic option types
  • Loading branch information
WesCossick authored Sep 8, 2021
2 parents 8808790 + 48f0c51 commit c57643c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils/construct-input-object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ export type InputObject<Input extends CommandInput> = OmitExcludeMeProperties<{
options: undefined extends Input['options']
? ExcludeMe
: {
[Option in keyof Input['options']]: string | number;
[Option in keyof Input['options']]:
| Input['options'][Option]
| (undefined extends Input['options'][Option] ? undefined : never);
};

/** If provided, the data given to this command. */
Expand Down

0 comments on commit c57643c

Please sign in to comment.