8000 fix: match drop transducer counts to list behavior by LucasLeao18 · Pull Request #3571 · ramda/ramda · GitHub
[go: up one dir, main page]

Skip to content

fix: match drop transducer counts to list behavior - #3571

Open
LucasLeao18 wants to merge 1 commit into
ramda:masterfrom
LucasLeao18:fix/drop-transducer-fractional-count
Open

LucasLeao18 wants to merge 1 commit into
ramda:masterfrom
LucasLeao18:fix/drop-transducer-fractional-count

Conversation

@LucasLeao18
Copy link
Copy Markdown

R.drop(0.5, xs) preserves all elements through Array.slice, but R.into([], R.drop(0.5), xs) removes one. The transducer decrements the raw fractional count and effectively rounds positive counts upward.

Floor the transducer count so fractional counts match the existing list behavior. Add parity cases for fractional, integer, negative, NaN and infinite counts.

Validation (Node.js 24.15.0, Windows): The new parity regression fails before the fix. npm test passes: 1,265 tests and ESLint.

AI assistance: this contribution was prepared with OpenAI Codex; the change and regression results were reviewed before submission.

@github-actions
Copy link
Copy Markdown
Coverage Summary
> ramda@0.32.0 coverage:summary
> BABEL_ENV=cjs nyc --reporter=text-summary mocha -- --reporter=min --require @babel/register

�[2J�[1;3H
1264 passing (802ms)


=============================== Coverage summary ===============================
Statements   : 94.22% ( 2574/2732 )
Branches     : 86.33% ( 1017/1178 )
Functions    : 93.57% ( 568/607 )
Lines        : 94.48% ( 2414/2555 )
================================================================================

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

0