- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 2.4k
 
docs: format isEmail options as bullet points for better readability #2619
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
base: master
Are you sure you want to change the base?
docs: format isEmail options as bullet points for better readability #2619
Conversation
          Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@            Coverage Diff            @@
##            master     #2619   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          114       114           
  Lines         2562      2562           
  Branches       649       649           
=========================================
  Hits          2562      2562           ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update: Revised to use only <br/> tags without bullets, maintaining the original paragraph structure while improving readability with strategic line breaks.
| **isDivisibleBy(str, number)** | check if the string is a number that is divisible by another. | ||
| **isEAN(str)** | check if the string is an [EAN (European Article Number)][European Article Number]. | ||
| **isEmail(str [, options])** | check if the string is an email.<br/><br/>`options` is an object which defaults to `{ allow_display_name: false, require_display_name: false, allow_utf8_local_part: true, require_tld: true, allow_ip_domain: false, allow_underscores: false, domain_specific_validation: false, blacklisted_chars: '', host_blacklist: [] }`. If `allow_display_name` is set to true, the validator will also match `Display Name <email-address>`. If `require_display_name` is set to true, the validator will reject strings without the format `Display Name <email-address>`. If `allow_utf8_local_part` is set to false, the validator will not allow any non-English UTF8 character in email address' local part. If `require_tld` is set to false, email addresses without a TLD in their domain will also be matched. If `ignore_max_length` is set to true, the validator will not check for the standard max length of an email. If `allow_ip_domain` is set to true, the validator will allow IP addresses in the host part. If `domain_specific_validation` is true, some additional validation will be enabled, e.g. disallowing certain syntactically valid email addresses that are rejected by Gmail. If `blacklisted_chars` receives a string, then the validator will reject emails that include any of the characters in the string, in the name part. If `host_blacklist` is set to an array of strings or regexp, and the part of the email after the `@` symbol matches one of the strings defined in it, the validation fails. If `host_whitelist` is set to an array of strings or regexp, and the part of the email after the `@` symbol matches none of the strings defined in it, the validation fails. | ||
| **isEmail(str [, options])** | check if the string is an email.<br/><br/>`options` is an object which defaults to `{ allow_display_name: false, require_display_name: false, allow_utf8_local_part: true, require_tld: true, allow_ip_domain: false, allow_underscores: false, domain_specific_validation: false, blacklisted_chars: '', host_blacklist: [] }`. <br/><br/>If `allow_display_name` is set to true, the validator will also match `Display Name <email-address>`. If `require_display_name` is set to true, the validator will reject strings without the format `Display Name <email-address>`.<br/>If `allow_utf8_local_part` is set to false, the validator will not allow any non-English UTF8 character in email address' local part. If `require_tld` is set to false, email addresses without a TLD in their domain will also be matched.<br/>If `ignore_max_length` is set to true, the validator will not check for the standard max length of an email. If `allow_ip_domain` is set to true, the validator will allow IP addresses in the host part.<br/>If `domain_specific_validation` is true, some additional validation will be enabled, e.g. disallowing certain syntactically valid email addresses that are rejected by Gmail.<br/>If `blacklisted_chars` receives a string, then the validator will reject emails that include any of the characters in the string, in the name part.<br/>If `host_blacklist` is set to an array of strings or regexp, and the part of the email after the `@` symbol matches one of the strings defined in it, the validation fails.<br/>If `host_whitelist` is set to an array of strings or regexp, and the part of the email after the `@` symbol matches none of the strings defined in it, the validation fails. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already better, but it would be great if we could keep the same format as for others. See this from isFQDN for example;
require_tld - If set to false the validator will not check if the domain includes a TLD.
allow_underscores - if set to true, the validator will allow underscores in the domain.
allow_trailing_dot - if set to true, the validator will allow the domain to end with a . character.
allow_numeric_tld - if set to true, the validator will allow the TLD of the domain to be made up solely of numbers.
allow_wildcard - if set to true, the validator will allow domains starting with *. (e.g. *.example.com or *.shop.example.com).
ignore_max_length - if set to true, the validator will not check for the standard max length of a domain.
Improves readability of
isEmailoptions by converting the dense paragraph into scannable bullet points while preserving all original technical content and functionality.Changes:
Makes it easier for developers to quickly understand and use the email validation options.