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: add is @IsPortNumber decorator #1735

Closed
wants to merge 102 commits into from
Closed

feat: add is @IsPortNumber decorator #1735

wants to merge 102 commits into from

Conversation

hungtcs
Copy link

@hungtcs hungtcs commented Sep 9, 2022

Description

Checklist

  • the pull request title describes what this PR does (not a vague title like Update index.md)
  • the pull request targets the default branch of the repository (develop)
  • the code follows the established code style of the repository
    • npm run prettier:check passes
    • npm run lint:check passes
  • tests are added for the changes I made (if any source code was modified)
  • documentation added or updated
  • I have run the project locally and verified that there are no errors

Fixes

fixes #826

dependabot bot added 30 commits November 22, 2021 09:06
@hungtcs hungtcs marked this pull request as ready for review September 9, 2022 04:04
@hungtcs hungtcs changed the title Add is port number decorator feat: add is port number decorator Sep 9, 2022
@braaar
Copy link
Member

braaar commented Sep 30, 2022

Could you write some tests for this?

@NoNameProvided
Copy link
Member

Closing this as wontfix because we won't add a second port decorator. We already have a @IsPort decorator. The discussion of how to handle string vs number should be discussed there and a solution implemented in the original one.

In the meantime, if you strictly want to accept numbers you can use the following:

class MyPayload {
  @IsNumber()
  @Min(0)
  @Max(65535)
  port: number;
}

@NoNameProvided NoNameProvided changed the title feat: add is port number decorator feat: add is @IsPortNumber decorator Nov 20, 2022
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

feat: IsPort decorator should accept number value
3 participants