feat: add filter method to Maybe and update documentation and tests #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new
filtermethod to theMaybetype, enabling value filtering based on predicates for both object-oriented and functional/curried usage. The change is thoroughly documented and tested, and includes updates to configuration and scripts for improved test coverage requirements.Maybe type enhancements
filter(fn: (value: T) => boolean): Maybe<T>method to theMaybeinterface, with implementations for bothJustandNothing. This allows filtering values in aMaybe, returningNothingif the predicate fails. [1] [2] [3]filterhelper for functional pipelines, enabling easy composition with otherMaybehelpers.Documentation improvements
docs/maybe/index.mdto explain and provide examples for the newfiltermethod and its curried usage. Includes common use cases like validation and parsing. [1] [2]Testing
filterfunctionality, covering direct usage, chaining, curried pipelines, and various scenarios. [1] [2]Configuration and scripts
bunfig.tomlto require 100% coverage for lines, functions, statements, and branches, and to skip test files from coverage calculations.package.jsonto run tests without the coverage flag, since coverage is now controlled via config.