Skip to content

fix: use ipairs in functional.all and add basic test coverage #659

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DavidAtBede
Copy link

fix(functional): use ipairs in all to avoid incorrect iteration over tables

Previously, functional.all used pairs, which can iterate non-numeric keys
and lead to incorrect behavior when passed list-style tables.

This patch switches to ipairs, preserving the existing (k, v) arity of the
predicate function but ensuring predictable, index-ordered traversal.

Added test coverage for all, including cases for full match, partial failure,
and empty input.

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.

1 participant