monet / monet.js

monet.js - Monadic types library for JavaScript
https://monet.github.io/monet.js/
MIT License
1.6k stars 114 forks source link

Change Maybe.filter[Not] to work as type guard #240

Closed mlrv closed 3 years ago

mlrv commented 3 years ago

Overload Maybe.filter and Maybe.filterNot to work with refinements and act as type guards, fixes #235

I'm not entirely sure how the tests in maybe.spec.ts are executed. Right now, the only thing that's asserted is that the types fit together in the right way.

ulfryk commented 3 years ago

@mlrv - maybe.spec.ts is only to check types, runtime is not executed. Functionality is tested in old JS tests.

( FYI: full revwirte to TS is on the way here --> https://github.com/monet/monet )