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(compat): Add map function #514

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

feat(compat): Add map function #514

wants to merge 6 commits into from

Conversation

iDevGon
Copy link
Contributor

@iDevGon iDevGon commented Sep 11, 2024

#301

This pull request implements the map function, which behaves similarly to the map function in lodash

The map function takes a collection and an iteratee function, applies the iteratee to each element of the collection, and returns a new array with the transformed results.

Below is a benchmark comparing our map function to lodash's map.

스크린샷 2024-09-11 23 45 55

Copy link

vercel bot commented Sep 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
es-toolkit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 12, 2024 2:43pm

# Conflicts:
#	src/compat/index.ts
return [];
}

const mapper: (value: T, key: string | number) => U =
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe you might check our some, indexOf function which similarly handles this. I think the documentation and implementation is better.

@raon0211
Copy link
Collaborator

Thanks for your pull request!

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