Skip to content

Validation extension added.#6

Open
purvesh-d wants to merge 3 commits intodevelopfrom
feature/base_function_added
Open

Validation extension added.#6
purvesh-d wants to merge 3 commits intodevelopfrom
feature/base_function_added

Conversation

@purvesh-d
Copy link
Copy Markdown
Collaborator

@purvesh-d purvesh-d commented Apr 17, 2023

Summary by AIReviewRadar 1.0.2

Release Notes:

  • New Feature: Added validation extensions for password, email, phone number, and web URL.
  • New Feature: Added a function to remove white spaces.

"Validations galore,
No more input errors to deplore.
With this PR, we can be sure,
Our user inputs are now secure."

@github-actions
Copy link
Copy Markdown

🤖 AIReviewRadar

Thank you for letting me participate in the code review.

The pull request titled "Validation extension added" adds validation extensions for password, email, phone number, and web URL. It also includes a function to remove white spaces. Overall, this is a useful addition to the codebase as it improves the quality of user input validation. The changes appear to be well-implemented and do not introduce any obvious issues. Therefore, I recommend merging this pull request.


Chat with 🤖 AIReviewRadar (@openai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @openai in a reply.

fun String.VerifyWebUrl(): Boolean = Patterns.WEB_URL.matcher(this).matches()

//Remove all white spaces
fun String.removeWhitespaces() = replace(" ", "")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AIReviewRadar

The code changes look good to me. However, I have a few suggestions for improvement:

  1. It would be better to use more descriptive names for the regular expression constants PHONE_REGEX, PHONE_REGEX_FORMAT, and PASSWORD_PATTERN. For example, VALID_PHONE_NUMBER_REGEX and STRONG_PASSWORD_REGEX.

  2. The function name VerifyWebUrl() should be changed to isValidWebUrl() to follow the naming convention used in the other functions.

  3. It would be helpful to add some comments explaining the regular expressions used in the code.

  4. It is recommended to use val instead of fun for removeWhitespaces() since it does not take any parameters.

With these improvements, the code will be easier to read and maintain. Please let me know if you have any questions or concerns.

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