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

new validator: isMailtoURI, validate the mailto link URI format #2188

Merged
merged 8 commits into from
Mar 27, 2023

Conversation

uksarkar
Copy link
Contributor

Added a new validation method for validating the mailto: link URI. Where it'll validate the URI format and also the email provided inside the appropriate query params.

Here is the format of a mailto link URI mailto:to(optional, comma-separated emails)?cc=(optional, comma-separated emails)&bb=(optional, comma-separated emails)&subject=(optional)&body=(optional)

Some links:
https://mailtrap.io/blog/mailto-links-explained/
https://en.wikipedia.org/wiki/Mailto

Checklist

  • PR contains only changes related; no stray files, etc.
  • README updated (where applicable)
  • Tests written (where applicable)
  • References provided in PR (where applicable)

@codecov
Copy link

codecov bot commented Feb 21, 2023

Codecov Report

Base: 100.00% // Head: 99.95% // Decreases project coverage by -0.05% ⚠️

Coverage data is based on head (49a2e12) compared to base (43803c0).
Patch coverage: 97.67% of modified lines in pull request are covered.

❗ Current head 49a2e12 differs from pull request most recent head 21fc562. Consider uploading reports for the commit 21fc562 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##            master    #2188      +/-   ##
===========================================
- Coverage   100.00%   99.95%   -0.05%     
===========================================
  Files          106      107       +1     
  Lines         2348     2391      +43     
  Branches       593      605      +12     
===========================================
+ Hits          2348     2390      +42     
- Partials         0        1       +1     
Impacted Files Coverage Δ
src/lib/isMailtoURI.js 97.61% <97.61%> (ø)
src/index.js 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@WikiRik
Copy link
Member

WikiRik commented Feb 21, 2023

Could you provide some use cases for this new validator? When would an user need to input such a mailto URI? Or when would you want to check this coming from another system? I think this would be a too niche use case for this project

@uksarkar
Copy link
Contributor Author

Could you provide some use cases for this new validator? When would an user need to input such a mailto URI? Or when would you want to check this coming from another system? I think this would be a too niche use case for this project

For projects like website builder, it would be great to provide the user some feedback about what they are trying to achieve and whether it's valid or not.

@profnandaa profnandaa changed the title isMailtoURI: validate the mailto: link URI format with the emails inside the URI new validator: isMailtoURI, validate the mailto link URI format Mar 7, 2023
Copy link
Member

@profnandaa profnandaa left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for your contrib! 🎉

@profnandaa profnandaa merged commit 9ba1735 into validatorjs:master Mar 27, 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