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

Merged
merged 5 commits into from
Oct 24, 2024

Conversation

Na-hyunwoo
Copy link
Contributor

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

@Na-hyunwoo Na-hyunwoo requested a review from raon0211 as a code owner October 15, 2024 13:16
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 22, 2024 11:08pm

@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
Contributor 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.

@raon0211
Copy link
Collaborator

As @dayongkr mentioned, I think we should handle that test case.

@Na-hyunwoo
Copy link
Contributor Author

Na-hyunwoo commented Oct 22, 2024

@dayongkr @raon0211

This corresponds to implicit type conversion.

Cool.

I will reflect this and commit.

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.

Thanks for your contribution!

@raon0211 raon0211 merged commit 415d325 into toss:main Oct 24, 2024
4 of 8 checks passed
@Na-hyunwoo Na-hyunwoo deleted the feat/uniqueId branch November 11, 2024 22:41
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.

3 participants