Skip to content

Conversation

@richecr
Copy link
Owner

@richecr richecr commented Nov 30, 2025

This pull request introduces new validation and filtering capabilities to the functional data types Either, Maybe, and Result, along with comprehensive documentation and tests for these features. Additionally, it strengthens code coverage requirements and makes minor test configuration adjustments.

Functional Enhancements

Either:

  • Added a validate method to the Either interface, allowing validation of Right values with custom error handling, and a curried helper for functional pipelines. [1] [2] [3] [4]
  • Updated documentation (docs/either/index.md) to explain usage patterns and provide real-world examples for both direct and curried validate. [1] [2]
  • Added thorough tests for validate on Either, covering direct usage, chaining, and functional composition. [1] [2] [3]

Maybe:

  • Added a filter method to the Maybe interface and a curried helper, enabling value filtering based on predicates. [1] [2] [3] [4]
  • Expanded documentation (docs/maybe/index.md) with examples and use cases for both direct and curried filter. [1] [2]
  • Added comprehensive tests for filter on Maybe, including chaining and pattern-based filtering. [1] [2]

Result:

  • Added a validate method to the Result interface and a curried helper for functional validation with error messages. [1] [2] [3] [4]
  • Updated documentation (docs/result/index.md) with usage patterns, including object validation and error handling. [1] [2]

Test & Coverage Configuration

  • Increased test coverage thresholds to 100% for lines, functions, statements, and branches in bunfig.toml, and enabled skipping test files from coverage.
  • Removed coverage flag from the test script in package.json to align with new coverage configuration.

These changes collectively enhance the expressiveness and composability of the library, making validation and filtering more idiomatic and robust for functional programming workflows.

@richecr richecr merged commit 90ce2fc into main Nov 30, 2025
1 check passed
@richecr richecr deleted the feat/added_validation_in_either_result branch December 2, 2025 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants