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
Compare this to A.filter which has an overload that allows for a type guard to be passed in:
exportdeclarefunctionfilter<A,BextendsA>(predicateFn: (value: A)=>value is B): (xs: Array<A>)=>Array<B>;
It would be nice to have the same for O.filter.
Here's an example that currently fails:
typeWithOrWithoutYou={type: 'with',you: string}|{type: 'without'};declareconstwithOrWithout: WithOrWithoutYou;pipe(O.some(withOrWithout),O.filter(w=>w.type==='with'),O.map(w=>w.you),// <--- Fails with: Property 'you' does not exist on type 'WithOrWithoutYou'.)
Thanks for a great library! 🙌
The text was updated successfully, but these errors were encountered:
The
O.filter
function doesn't have an overload that takes type guards into account. The only definition that exists looks like this:Compare this to
A.filter
which has an overload that allows for a type guard to be passed in:It would be nice to have the same for
O.filter
.Here's an example that currently fails:
Thanks for a great library! 🙌
The text was updated successfully, but these errors were encountered: