Closed hayes closed 5 years ago
well, this fixes one set of issues, but there is another issue now.
Now that there is proper type for the args object, this reveals another type issue with strict unions and default args. There is no valid way to pass an empty object to take advantage of the default. Working on a fix
@kevin-greene-ck This ended up being a little more complicated than I initially imagined.
There were 3 issues that came up when adding a type for the obj
variable for encoding strict unions:
To fix this I did 3 things:
IUnionNameDefaultArgs
interface that has all values as undefined and included it in the args union type.@kevin-greene-ck any chance you could cut another pre-release with this change?
Bump
@kevin-greene-ck thanks for merging this, would you be able to cut a release with this change as well?
@kevin-greene-ck this should fix #166
I could separate the logic for unions vs structs if you think it would be better to keep the previous logic for structs. I think the
as
cast is required for unions though.