feat(collections): stabilize index argument in iterable methods#7119
Open
tomas-zijdemans wants to merge 3 commits into
Open
feat(collections): stabilize index argument in iterable methods#7119tomas-zijdemans wants to merge 3 commits into
tomas-zijdemans wants to merge 3 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7119 +/- ##
==========================================
+ Coverage 94.61% 94.80% +0.19%
==========================================
Files 634 618 -16
Lines 51801 51472 -329
Branches 9329 9276 -53
==========================================
- Hits 49011 48798 -213
+ Misses 2216 2122 -94
+ Partials 574 552 -22 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
fibibot
approved these changes
May 13, 2026
fibibot
left a comment
There was a problem hiding this comment.
Clean stabilization. Unstable index parameter was added in #6382 (merged Jan 2026), so it's had ~4 months of in-tree usage. All 17 unstable files removed, deno.json exports cleaned up, tests rewired to the stable imports. The implementations correctly hand off the index — sortBy reuses the loop index i, the iterator paths use index++, Array.findIndex in dropWhile's array branch already takes the index natively.
- nit: JSDoc inconsistency —
sortBy,takeWhile,takeLastWhile, andfirstNotNullishOfkeep their pre-stabilization@paramtext and don't pick up the "The function receives the element and its index" wording or the "Using the index parameter"@examplethat the other 12 stabilized functions added. Worth aligning so users discover the new parameter from the docs.
|
@bartlomieju this is ready to merge |
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.
This PR is a follow up to #6382
IMHO, adding the index argument should be quite natural and risk free.
I tried to keep the scope clean: Only stabilize what that PR added as unstable.