Skip to content

Add index and array parameters to array function callbacks - #1561

Merged
raon0211 merged 12 commits into
toss:mainfrom
T3sT3ro:1557/array-functions-index-array-params
Jan 15, 2026
Merged

raon0211 merged 12 commits into
toss:mainfrom
T3sT3ro:1557/array-functions-index-array-params

Conversation

@T3sT3ro

@T3sT3ro T3sT3ro commented Dec 19, 2025

Copy link
Copy Markdown
Contributor

Implements #1557 — adding index and array parameters when appropriate to several array function callbacks:

  • flatMap
  • flatMapDeep
  • uniqBy
  • minBy
  • maxBy
  • keyBy
  • countBy
  • groupBy
  • takeRightWhile
  • takeWhile
  • partition
  • zipWith

For now those are the functions I am aware of where the callback with index/array makes sens. If you have other propositions comment in here and I will add it.

@vercel

vercel Bot commented Dec 19, 2025 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
es-toolkit Ready Ready Preview, Comment Dec 19, 2025 11:49am

@T3sT3ro
T3sT3ro force-pushed the 1557/array-functions-index-array-params branch from cb64c32 to fdd3c8e Compare December 19, 2025 10:54
@T3sT3ro

T3sT3ro commented Dec 19, 2025 •

Copy link
Copy Markdown
Contributor Author

I see that the tests for compat of uniqBy and unionBy failed due to extra parameters being passed to the callback. I have wrapped the compatibility function iteratees with ary(fn ,1) to strip down extra index and array parameters, I think that's the safest option.

@T3sT3ro

T3sT3ro commented Dec 21, 2025

Copy link
Copy Markdown
Contributor Author

Those build errors look to be external and irrelevant of this PR.

@raon0211 raon0211 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much!

@raon0211
raon0211 merged commit a46806b into toss:main Jan 15, 2026
8 of 10 checks passed

This branch was successfully deployed

1 active deployment
Preview — 891e5529 Deployed Dec 19, 2025 by vercel[bot]
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.

2 participants