Skip to content

Commit 08b8019

Browse files
authored
Merge pull request #51 from fredeil/fredeil-patch-1
Update email_validator.dart
2 parents 0d4b267 + e968709 commit 08b8019

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

lib/email_validator.dart

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,19 @@ class EmailValidator {
1616
static const String _atomCharacters = "!#\$%&'*+-/=?^_`{|}~";
1717
static SubdomainType _domainType = SubdomainType.None;
1818

19-
// Returns true if the first letter in string c has a 16-bit UTF-16 code unit
20-
// greater than or equal to 48 and less than or equal to 57
21-
// otherwise return false
2219
static bool _isDigit(String c) {
2320
return c.codeUnitAt(0) >= 48 && c.codeUnitAt(0) <= 57;
2421
}
2522

26-
// Returns true if the first letter in string c has a 16-bit UTF-16 code unit
27-
// greater than or equal to 65 and less than or equal to 90 (capital letters)
28-
// or greater than or equal to 97 and less than or equal to 122 (lowercase letters)
29-
// otherwise return false
3023
static bool _isLetter(String c) {
3124
return (c.codeUnitAt(0) >= 65 && c.codeUnitAt(0) <= 90) ||
3225
(c.codeUnitAt(0) >= 97 && c.codeUnitAt(0) <= 122);
3326
}
3427

35-
// Returns true if calling isLetter or isDigit with the same string returns true
36-
// Only returns false if both isLetter and isDigit return false
3728
static bool _isLetterOrDigit(String c) {
3829
return _isLetter(c) || _isDigit(c);
3930
}
4031

41-
// Returns value of allowInternational if the first letter in the string c isnt a
42-
// number or letter or special character otherwise
43-
// return the result of _isLetterOrDigit or _atomCharacters.contains(c)
44-
// which only returns false if both _isLetterOrDigit and _atomCharacters.contains(c)
45-
// returns false
4632
static bool _isAtom(String c, bool allowInternational) {
4733
return c.codeUnitAt(0) < 128
4834
? _isLetterOrDigit(c) || _atomCharacters.contains(c)

0 commit comments

Comments
 (0)