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(difference, intersection): add multiset variants #636

Merged
merged 6 commits into from
Apr 17, 2024

Conversation

eranhirsch
Copy link
Collaborator

Adding a variant difference for multiset semantics and update the deprecation warning.

Copy link

codesandbox-ci bot commented Apr 13, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 5f07e7e:

Sandbox Source
remeda-example-vanilla Configuration

Copy link
Collaborator

@cjquines cjquines left a comment

Choose a reason for hiding this comment

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

let's include an example with duplicate values to illustrate the difference?

@@ -5,7 +5,7 @@ import { purry } from "./purry";
/**
* Excludes the values from `other` array.
*
* ! **DEPRECATED**: Use `R.filter(array, R.isNot(R.isIncludedIn(other)))`. Will be removed in v2!
* ! **DEPRECATED**: The runtime implementation of this function handles duplicate values inconsistently. In v2 a new implementation would replace it; this implementation is accessible to v1 users via the `multiset` variant of this function (`R.difference.multiset`), or to maintain the same runtime implementation use `R.filter(array, R.isNot(R.isIncludedIn(other)))` instead.
Copy link
Collaborator

Choose a reason for hiding this comment

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

suggestion:

Suggested change
* ! **DEPRECATED**: The runtime implementation of this function handles duplicate values inconsistently. In v2 a new implementation would replace it; this implementation is accessible to v1 users via the `multiset` variant of this function (`R.difference.multiset`), or to maintain the same runtime implementation use `R.filter(array, R.isNot(R.isIncludedIn(other)))` instead.
* ! **DEPRECATED**: In v2, `R.difference.multiset` will replace `R.difference`. To keep current behavior, use `R.filter(array, R.isNot(R.isIncludedIn(other)))` instead.

@eranhirsch eranhirsch force-pushed the eranhirsch/v1/undeprecateDifference branch from c8c5e28 to dcecc69 Compare April 14, 2024 07:42
@eranhirsch eranhirsch changed the title feat(difference): add multiset variant feat(difference, intersection): add multiset variant Apr 14, 2024
@eranhirsch eranhirsch changed the title feat(difference, intersection): add multiset variant feat(difference, intersection): add multiset variants Apr 14, 2024
@eranhirsch eranhirsch force-pushed the eranhirsch/v1/undeprecateDifference branch from 0685b81 to 5f07e7e Compare April 14, 2024 09:52
@cjquines
Copy link
Collaborator

hooray 🎉

does this make #368 no longer needed? are multiset semantics going to be our default moving-forward, and does that mean we want the other multiset helpers, or what?

@eranhirsch
Copy link
Collaborator Author

does this make #368 no longer needed?

Other utilities we don't offer or don't offer correctly would need to be ported, too. For now, it's a good template for me to copy from and a reminder to do it.

@eranhirsch eranhirsch merged commit 9ebfff0 into master Apr 17, 2024
20 checks passed
@eranhirsch eranhirsch deleted the eranhirsch/v1/undeprecateDifference branch April 17, 2024 06:51
@TkDodo
Copy link
Collaborator

TkDodo commented Apr 17, 2024

🎉 This PR is included in version 1.60.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants