Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reduce and reduceRight support other accumulator types, fix #10 #12

Merged
merged 1 commit into from
Feb 7, 2023

Conversation

doronhorwitz
Copy link
Contributor

@doronhorwitz doronhorwitz commented Jan 31, 2023

What does this pull request add, improve or fixes?

Fixes #10

Can you explain why this improvement or fix may be useful?

As discussed in the issue. Note that the solution involves overloading the reduce and reduceRight definitions to have versions that don't include an initial value. This matches with the way it's done in the TypeScript definitions for the native reduce and reduceRight

If you changed the code, have you added enough unit tests?

This is a TypeScript definitions fix, so there's no tests to add

@nicolas-van
Copy link
Owner

Seems good to me, I merged it and will make a new release.

@nicolas-van
Copy link
Owner

Version 1.1.3 was released with that fix. Thank you for your contribution.

@doronhorwitz
Copy link
Contributor Author

Version 1.1.3 was released with that fix. Thank you for your contribution.

Very happy to contribute, you've developed a really great package.

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.

For reduce and reduceRight it should be possible to use any type for accumulator
2 participants