Skip to content

refactor: migrate component signatures to use array for multiple items #31

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

Merged
merged 4 commits into from
Dec 23, 2023

Conversation

mdjastrzebski
Copy link
Member

@mdjastrzebski mdjastrzebski commented Dec 22, 2023

Summary

Modify signatures for calling regex components:

// Can pass single component as argument
capture('a') 

// Multiple components need to be passed as array
capture(['a', 'b'])

This is motivated primarily by choiceOf component which should accept a number of different patterns:

choiceOf('a', 'b', 'c'); // "a|b|c"
choiceOf([oneOrMore('a'), 'b'], [oneOrMore('x'), 'y']); // "a+b|x+y"

Test plan

@codecov-commenter
Copy link

codecov-commenter commented Dec 22, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e23d0d6) 100.00% compared to head (0db7f5e) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #31   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9        12    +3     
  Lines          142       145    +3     
  Branches        36        38    +2     
=========================================
+ Hits           142       145    +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mdjastrzebski mdjastrzebski merged commit 7a4b1d7 into main Dec 23, 2023
@mdjastrzebski mdjastrzebski deleted the refactor/components-signature branch December 23, 2023 22:24
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.

2 participants