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(uniqueId): Add uniqueId to compat layer #714

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

Conversation

Na-hyunwoo
Copy link

Implemented lodash's uniqueId.

If there is anything that needs supplementation, please give me feedback.

I will fix it right away.

Thank you.

uniqueId benchmark

Copy link

vercel bot commented Oct 15, 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 Oct 21, 2024 11:25pm

@dayongkr
Copy link
Contributor

The functions in compat layer should pass the lodash’s test code. Please refer to the #732 PR!

@dayongkr
Copy link
Contributor

And reading this issue will be helpful!

@Na-hyunwoo
Copy link
Author

Na-hyunwoo commented Oct 21, 2024

Hi! @dayongkr

When defining utility functions in the compat layer, we should follow lodash's test!

Thank you for your good comments.

The uniqueId you created was more readable, so I changed my code a bit.

And in my opinion, it is better not to verify lodash's third test code because it does not match es-toolkit's design principles.

What do you think?

Give you ref: Design Principles

스크린샷 2024-10-22 오전 8 28 04

@dayongkr
Copy link
Contributor

dayongkr commented Oct 22, 2024

Design Principles

Thank you for reviewing my opinion.

I think that seems to refer to cases where JavaScript implicitly converts types at the language level(e.g. '3' + 3 === '3' + '3'). However, the test case involves explicitly coercing a number into a string, so I think it is necessary.

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