Skip to content
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

feat(flatMap): add flatMap function #209

Merged
merged 4 commits into from
Jul 15, 2024
Merged

Conversation

ssi02014
Copy link
Contributor

close: #168

Add a flatMap function based on flatten.
This improves on the shortcoming of flatMap, which can only be used at depth 1.

It works the same as map(iteratee).flat(depth), but is faster.

benchmark

스크린샷 2024-07-15 오후 4 21 24

@ssi02014 ssi02014 requested a review from raon0211 as a code owner July 15, 2024 07:23
Copy link

vercel bot commented Jul 15, 2024

@ssi02014 is attempting to deploy a commit to the Toss Team on Vercel.

A member of the Team first needs to authorize it.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.80%. Comparing base (deb3882) to head (63b352e).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #209   +/-   ##
=======================================
  Coverage   99.79%   99.80%           
=======================================
  Files          86       87    +1     
  Lines         497      500    +3     
  Branches       77       78    +1     
=======================================
+ Hits          496      499    +3     
  Misses          1        1           

src/array/flatMap.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@raon0211 raon0211 left a comment

Choose a reason for hiding this comment

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

Looks great. Thanks for your contribution!

@raon0211 raon0211 merged commit fec678c into toss:main Jul 15, 2024
5 of 7 checks passed
@ssi02014 ssi02014 deleted the feat/flatMap branch July 15, 2024 13:43
seungrodotlee pushed a commit to seungrodotlee/es-toolkit that referenced this pull request Jul 18, 2024
* feat(flatMap): add flatMap function

* docs: fix docs

* Update src/array/flatMap.ts

---------

Co-authored-by: Sojin Park <raon0211@gmail.com>
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.

Support for flatMap
3 participants