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

refactor: strike and pattern to use overloads #22

Merged
merged 2 commits into from Apr 19, 2020

Conversation

cakekindel
Copy link
Collaborator

As nice as using the rest arguments would be, I decided to switch strike and pattern to use explicit overloads for up to 10 match arms.

this choice was made because strike & pattern need to TELL match what type TIn is, to prevent having to explicitly tell each match arm what type it's matching on

this change also simplifies the signatures of strike and pattern. While there are a lot, it should hopefully be easier to unpack.

As nice as using the rest arguments would be, I decided to switch strike and pattern to use explicit overloads for up to 10 match arms.

this choice was made because  strike & pattern need to TELL match what type TIn is, to prevent having to explicitly tell each match arm what type it's matching on

 this change also simplifies the signatures of strike and pattern. While there are a lot, it should hopefully be easier to unpack.
@codecov
Copy link

codecov bot commented Apr 19, 2020

Codecov Report

Merging #22 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #22   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           20        20           
  Lines          102       103    +1     
  Branches        15        15           
=========================================
+ Hits           102       103    +1     
Impacted Files Coverage Δ
src/public/match.ts 100.00% <ø> (ø)
src/internal/match-testing/match-ctor-tester.ts 100.00% <100.00%> (ø)
src/public/pattern.ts 100.00% <100.00%> (ø)
src/public/strike.ts 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c5e960c...18e342c. Read the comment docs.

@cakekindel cakekindel merged commit 4e43728 into master Apr 19, 2020
@cakekindel cakekindel deleted the test-e2e/cover-structural-matching branch April 19, 2020 22:53
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.

None yet

1 participant