-
Notifications
You must be signed in to change notification settings - Fork 129
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(multisets): add difference, union, intersect, isContains, symmetric difference (xor), and isEqual #368
base: master
Are you sure you want to change the base?
Conversation
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 e64e0f1:
|
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #368 +/- ##
==========================================
+ Coverage 99.88% 99.90% +0.01%
==========================================
Files 112 128 +16
Lines 6845 8007 +1162
Branches 618 709 +91
==========================================
+ Hits 6837 7999 +1162
Misses 8 8
☔ View full report in Codecov by Sentry. |
I have some ideas about how to get this API right, I want to drop the multiset names and just rename the regular functions, i'll send out smaller PRs in the near future |
@eranhirsch Just curious about this one - any luck? |
It's a busy period for me and I didn't get around to doing this. You can see it's a pretty big change if we want to cover all the cases, i want to split this into smaller parts but I just didn't find the time yet. |
A type-guard that checks existence in a set of values. Useful for narrowing possible enum (literal union) values via a global const. Optimizes dataFirst and dataLast implementations offering better performance for each case. Deprecated intersection and difference in favour of using filter in combination with isIncludedIn so we can take advantage of the performance gains and optimizations, and to make room for future interestion and difference functions which will work more closely to the mathematical definitions of multi-sets (which take into account duplicate items, as could be present in arrays). See #368 --- Make sure that you: - [x] Typedoc added for new methods and updated for changed - [x] Tests added for new methods and updated for changed - [x] New methods added to `src/index.ts` - [ ] New methods added to `mapping.md` --- <details><summary>We use semantic PR titles to automate the release process!</summary> https://conventionalcommits.org PRs should be titled following using the format: `< TYPE >(< scope >)?: description` ### Available Types: - `feat`: new functions, and changes to a function's type that would impact users. - `fix`: changes to the runtime behavior of an existing function, or refinements to it's type that shouldn't impact most users. - `perf`: changes to function implementations that improve a functions _runtime_ performance. - `refactor`: changes to function implementations that are neither `fix` nor `perf` - `test`: tests-only changes (transparent to users of the function). - `docs`: changes to the documentation of a function **or the documentation site**. - `build`, `ci`, `style`, `chore`, and `revert`: are only relevant for the internals of the library. For scope put the name of the function you are working on (either new or existing). </details>
difference and intersection are now part of v1 as a variant ( Other functions would be added directly to v2 after release. |
Adding multi-set functions:
isDisjoint(this doesn't have any multiset specific impl concerns)Closes #363
Make sure that you:
src/index.ts