Generic implementation of Max and Min functions.#186
Merged
kutyel merged 3 commits intokutyel:masterfrom Jul 21, 2025
Merged
Conversation
Supports number, string, and boolean types using built-in comparers. For unsupported types, a custom comparer must be provided.
kutyel
requested changes
Jul 18, 2025
Owner
kutyel
left a comment
There was a problem hiding this comment.
Hi!
Thank you very much for you contribution, it looks really good and I'm happy to merge it as a major change if you address a couple of minor comments I have 😉
When merging this with a major commit message a new mayor release will be auto-released so no worry about the breaking changes.
Thanks for your effort and work you put into this! I especially appreciate the effort you made to make it closer to C#, this was the overall goal of this library after all! 👏🏻
kutyel
approved these changes
Jul 21, 2025
Owner
kutyel
left a comment
There was a problem hiding this comment.
LGTM, huge thanks for you contribution! 🎉
|
🎉 This PR is included in version 3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Supports number, string, and boolean types using built-in comparers.
For unsupported types, a custom comparer must be provided.
Details
This pull request is important and essential because it addresses a fundamental limitation in the existing implementation by removing the hardcoded assumption that all comparers return a number. By introducing support for built-in comparers for number, string, and boolean types—and requiring explicit custom comparers for other types—we significantly improve type safety, flexibility, and clarity in the API.
Additionally, the updated method signatures now better reflect the semantics of similar functionality in C#, aligning the design with established .NET practices. This not only enhances code readability and maintainability for developers familiar with LINQ-style patterns, but also lays a stronger foundation for future extensibility.
Breaking change:
The method signatures have been modified to avoid hardcoding the return type as number. The new design more closely aligns with the original implementation in C# and improves type flexibility.
From:
To: