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
{{ message }}
This repository has been archived by the owner on Feb 26, 2021. It is now read-only.
The issue of #10 stays and 'just switch to intersection instead of union' is not a solution. The same is valid for 'just assign it to any' as pointed out in #12 .
The parameter passed into data would have to be dynamically converted to an intersection of all union types. This conversion is already sketchy by itself (microsoft/TypeScript#29594). I'm not even sure if it's possible to dynamically narrow a union based on dynamic parameters within a library - after all, it would have already been done for Array.prototype.filter.
Edit:
I think I might have this working? Needs a lot more testing.
The issue of #10 stays and 'just switch to intersection instead of union' is not a solution. The same is valid for 'just assign it to any' as pointed out in #12 .
Issue illustrated in #10 or at https://stackblitz.com/edit/ts-optchain-any-g9clab?file=index.ts
The text was updated successfully, but these errors were encountered: