You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This currently gives a type error on the .del function since it cannot accept a union of string or string[].
I would expect that there is no type error since the code above simply works.
Either passing a single key or an array of keys gives the correct result.
The current workaround is forcing the string to be an array, but that's weird to cast here just for typing.
I didn't know there was such a limit. Thanks for raising this up! Seems to be an issue on TypeScript side microsoft/TypeScript#14107. I'm open to it if there is an easy way to fix it on our side.
Consider a function to remove a single key/array of keys:
This currently gives a type error on the
.del
function since it cannot accept a union ofstring
orstring[]
.I would expect that there is no type error since the code above simply works.
Either passing a single key or an array of keys gives the correct result.
The current workaround is forcing the string to be an array, but that's weird to cast here just for typing.
What do you think? Is this the intended behavior or could we loosen/improve the typing here?
The text was updated successfully, but these errors were encountered: