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(isSubsetWith): update isSubset for object array support #783

Merged
merged 2 commits into from
Nov 3, 2024

Conversation

kaehehehe
Copy link
Contributor

close #767

I've made it so that we can use IsSubset with object arrays.
Here are the benchmark results.

스크린샷 2024-11-02 19 13 07

Copy link

vercel bot commented Nov 2, 2024

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

Name Status Preview Comments Updated (UTC)
es-toolkit 🛑 Canceled (Inspect) Nov 3, 2024 7:54am

@raon0211
Copy link
Collaborator

raon0211 commented Nov 2, 2024

For this use case, we should create a new function called isSubsetWith. Users can then use it like this:

isSubsetWith(arr1, arr2, (x, y) => isEqualWith(x, y));

This approach aligns well with other functions like difference and union.

@kaehehehe
Copy link
Contributor Author

I think that makes sense. I went ahead and implemented the isSubsetWith function! :)

@raon0211 raon0211 changed the title feat: update isSubset for object array support feat(isSubsetWith): update isSubset for object array support Nov 3, 2024
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 6244714 into toss:main Nov 3, 2024
6 of 8 checks passed
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.14%. Comparing base (1e0be6b) to head (d52dea3).
Report is 7 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #783   +/-   ##
=======================================
  Coverage   99.13%   99.14%           
=======================================
  Files         299      302    +3     
  Lines        2664     2675   +11     
  Branches      777      782    +5     
=======================================
+ Hits         2641     2652   +11     
  Misses         22       22           
  Partials        1        1           

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.

Improve isSubset to Handle Object Comparisons Correctly
3 participants