This repository has been archived by the owner on Jan 5, 2024. It is now read-only.
Function setup-haskell.run
has incorrect type
#121
Labels
re: inputs
Concerning handling the inputs to this action
refactor
Concerning refactoring the code base
Milestone
The function
run
insetup-haskell.ts
has the following type:The type
Record<string, string>
is the type of objects which map any string to a string. The inputs, however, only has the propertiesghc-version
,cabal-version
,stack-version
,enable-stack
,stack-no-global
,stack-setup-ghc
, anddisable-matcher
, and will returnundefined
for any other properties.Therefore a more correct type would be
Record<string, string | undefined>
and the exact type would be something along the lines of:...or:
The same problem applies to the type given to
yamlInputs
inopts.ts
, which promises a default value for every possible string, while one isn't even provided for all of the default options. Therefore, a more correct type would be eitherRecord<string, {default: string} | undefined>
or:...or the more-or-less equivalent interface, as above.
(When taking the first approach, you could embed
SetupInputWithDefaultName
intoSetupInputName
.)The text was updated successfully, but these errors were encountered: