Skip to content

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