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(core): add support to named groups #11118

Merged
merged 1 commit into from
Apr 17, 2023

Conversation

elplancton
Copy link
Contributor

@elplancton elplancton commented Feb 15, 2023

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

Using named groups of regex in host option works correctly
image

But, when I use the HostParam decorator there is nothing there
image

Returns an empty object
image

If I don't use named groups, just capture groups, it works, however, the indexing is numerical. HostParam works fine with Express dynamic routes (host = ':accountId.localhost.com'), but doesn't understand full regex usage.
Issue Number: N/A

What is the new behavior?

Named groups are now read correctly.
image

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Just added support for reading named groups as well.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 522a29eb-9119-42f8-a9d5-f1324700b406

  • 0 of 5 (0.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.05%) to 92.832%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/core/router/router-explorer.ts 0 5 0.0%
Files with Coverage Reduction New Missed Lines %
packages/core/router/router-explorer.ts 1 73.94%
Totals Coverage Status
Change from base Build 4c7d292d-55db-4e03-babe-a68e13260628: -0.05%
Covered Lines: 6488
Relevant Lines: 6989

💛 - Coveralls

@kamilmysliwiec
Copy link
Member

Any chance we could add a simple test that confirms that this works as expected?

@kamilmysliwiec kamilmysliwiec added this to the 10.0.0 milestone Apr 17, 2023
@kamilmysliwiec kamilmysliwiec changed the base branch from master to 10.0.0 April 17, 2023 11:09
@kamilmysliwiec kamilmysliwiec merged commit b908f1a into nestjs:10.0.0 Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants