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: Fully support all path-to-regex features in RestEndpoint.path types #3054

Merged
merged 1 commit into from
May 7, 2024

Conversation

ntucker
Copy link
Collaborator

@ntucker ntucker commented May 7, 2024

Motivation

Better support for path-to-regex features

Solution

  • Move some type tests out of jest for faster CI

  • Add + and * in type for RestEndpoint.path

  • Add support for {} to RestEndpoint.path

    const getThing = new RestEndpoint({
      path: '/:attr1?{-:attr2}?{-:attr3}?',
    });
    
    getThing({ attr1: 'hi' });
    getThing({ attr2: 'hi' });
    getThing({ attr3: 'hi' });
    getThing({ attr1: 'hi', attr3: 'ho' });
    getThing({ attr2: 'hi', attr3: 'ho' });

Copy link

changeset-bot bot commented May 7, 2024

🦋 Changeset detected

Latest commit: 4b7e77d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@data-client/rest Patch
rdc-website Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

codecov bot commented May 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.49%. Comparing base (bfc5338) to head (a31563f).

❗ Current head a31563f differs from pull request most recent head 4b7e77d. Consider uploading reports for the commit 4b7e77d to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3054   +/-   ##
=======================================
  Coverage   98.49%   98.49%           
=======================================
  Files         122      122           
  Lines        2193     2193           
  Branches      448      448           
=======================================
  Hits         2160     2160           
  Misses         21       21           
  Partials       12       12           

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

@ntucker ntucker changed the title internal: Start moving some type only tests out of jest feat: Support + and \* in RestEndpoint.path May 7, 2024
@ntucker ntucker changed the title feat: Support + and \* in RestEndpoint.path feat: Support + and * in RestEndpoint.path May 7, 2024
@ntucker ntucker changed the title feat: Support + and * in RestEndpoint.path feat: Fully support all path-to-regex features in RestEndpoint.path types May 7, 2024
@ntucker ntucker merged commit bac0ca7 into master May 7, 2024
23 checks passed
@ntucker ntucker deleted the typetest branch May 7, 2024 16:46
@github-actions github-actions bot mentioned this pull request May 7, 2024
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