-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
maintenance: release 2301 prep - v13.9.0 #2166
Conversation
* Fixes #1761 for Bangladesh and Myanmar Mobile Validation and Test * Updated README.md for the Myanmar Mobile Number * Updated Test for the Myanmar Mobile Number * Fixing the Myanmar Prefix * Reverting the Change on the Mobile Number for BD * Fixing the Naming Convention and Pattern
* feat(isMACAddress): add EUI-64 validation * Update src/lib/isMACAddress.js Co-authored-by: Sarhan Aissi <[email protected]> * Add possible values of eui to README.md Co-authored-by: Rik Smale <[email protected]> Co-authored-by: Sarhan Aissi <[email protected]>
* feat: add support for Swedish license plates * feat: allow spaces * fix(docs): sort alphabetically * fix(isLicensePlate): Trim, disallow 0 and fix regex
* Additional test cases for isPostalCode validator CA, PL, UA * [The Social Insurance Number (SIN)](https://www.canada.ca/en/employment-social-development/services/sin.html) * Function docstring corrected * Canadian SIN is a part of general TaxID validator * Redundant line of code + test fixed * Valid ISO 639-1 + ISO 3166-1 alpha 2 locale
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated Signed-off-by: Tobias Speicher <[email protected]>
Forgot to remove the old regex in my last commit
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.
I haven't taken a look at the changed test file (yet), but I do have some remarks on things we should update in the future. But it's not for this release, we should be able to ship it with these commits
dinersclub: /^3(?:0[0-5]|[68][0-9])[0-9]{11}$/, | ||
discover: /^6(?:011|5[0-9][0-9])[0-9]{12,15}$/, | ||
jcb: /^(?:2131|1800|35\d{3})\d{11}$/, | ||
mastercard: /^5[1-5][0-9]{2}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$/, // /^[25][1-7][0-9]{14}$/; |
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.
Not sure why this alternative RegExp is in the comments, but maybe we can look at that in #2117
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.
it looks like the comment is a more "generalized" version of the final regexp used here.
I would tend to vote to remove the comment, it only causes confusion, but again, this can be part of my refactor #2117
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.
Yes, I think removal is the best and also best to do in the refactor
@@ -132,6 +149,9 @@ const phones = { | |||
'zh-CN': /^((\+|00)86)?(1[3-9]|9[28])\d{9}$/, | |||
'zh-TW': /^(\+?886\-?|0)?9\d{8}$/, | |||
'dz-BT': /^(\+?975|0)?(17|16|77|02)\d{6}$/, | |||
'ar-YE': /^(((\+|00)9677|0?7)[0137]\d{7}|((\+|00)967|0)[1-7]\d{6})$/, | |||
'ar-EH': /^(\+?212|0)[\s\-]?(5288|5289)[\s\-]?\d{5}$/, |
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.
Not just this one, but we should not check for [\s\-]
in this validator. But that's part of #2124
'bg-BG': bgBgCheck, | ||
'cs-CZ': csCzCheck, | ||
'de-AT': deAtCheck, | ||
'de-DE': deDeCheck, | ||
'dk-DK': dkDkCheck, | ||
'el-CY': elCyCheck, | ||
'el-GR': elGrCheck, | ||
'en-CA': isCanadianSIN, |
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 should have been called enCaCheck
but we can fix this in a later refactor, it doesn't affect the user
clean-up #1932 --------- Co-authored-by: Mik <[email protected]>
- fixes #2040 - clean-up #2041 Co-authored-by: coolbeatz71 <[email protected]>
Co-authored-by: Alvaro Castro <[email protected]> @profnandaa: clean up #2103
@@ -342,6 +342,37 @@ const validators = { | |||
}; | |||
return checkIdCardNo(str); | |||
}, | |||
'zh-HK': (str) => { | |||
// sanitize user input | |||
str = str.trim(); |
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.
IMHO, this sanitization step does not belong inside the validator, but I guess we can take a look after the release.
related issue #2158
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.
Sure.
@@ -11,10 +11,11 @@ const patterns = { | |||
AT: fourDigit, | |||
AU: fourDigit, | |||
AZ: /^AZ\d{4}$/, | |||
BA: /^([7-8]\d{4}$)/, |
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.
that [7-8]
range is unnecessary, but that is a tiny style issue only.
#2141 will be dealing with a lot of these
@profnandaa |
fix(isEmail): fixed `isFQDN` still checking email length when `ignore_max_length` is `true` profnandaa: clean-up #2128 --------- Co-authored-by: Said Akhmedbayev <[email protected]> Co-authored-by: Said Akhmedbayev <[email protected]>
* maintentance: clean up, closes #2073 --------- Co-authored-by: Digambar <[email protected]>
* maintenance: clean up #2061 --------- Co-authored-by: djeks922 <[email protected]>
Co-authored-by: Frederike Ramin <[email protected]>
chore: combined PR clean-up
Codecov ReportBase: 100.00% // Head: 100.00% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## release_2301 #2166 +/- ##
===============================================
Coverage 100.00% 100.00%
===============================================
Files 102 105 +3
Lines 2059 2324 +265
Branches 464 586 +122
===============================================
+ Hits 2059 2324 +265
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. |
Oh, sure, will include that in a fix commit. |
@profnandaa nice work! :-) also would be maybe nice if #2107 could be mentioned under "Documentation fixes" as well :-) ;-) |
@pano9000 - sure, will add that in the release note.
I'll add documentation about our versioning in the wiki:
1. We use semver: M.m.f
2. a new validator is taken as a new feature, so bumps up m+1
3. An enhancement (eg adding new locale) or fix to an existing validator is
taken as a fix, so we bump f+1 (that's if there was no bump in (1) above)
4. When there's a breaking change, we bump M+1.
So we had 2 new validators, hence 13.(7+2).0
Hope this clarifies.
./na
…On Thu, Feb 2, 2023, 10:57 Panagiotis Papadopoulos ***@***.***> wrote:
@profnandaa <https://github.com/profnandaa> nice work! :-)
Question: is there a reason for this being 13.9.0 and not 13.8.0, when
the last version was 13.7.0?
also would be maybe nice if #2107
<#2107> could be
mentioned under "Documentation fixes" as well :-) ;-)
—
Reply to this email directly, view it on GitHub
<#2166 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAB7ZELS66QO6QCYNX22WCTWVNSE5ANCNFSM6AAAAAAUMBMQTI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Co-authored-by: Rik Smale <[email protected]> Co-authored-by: ST-DDT <[email protected]> - rename isLuhnValid -> isLuhnNumber - docs: add th-TH in isAlpha*
@@ -143,7 +143,7 @@ Validator | Description | |||
**isLicensePlate(str, locale)** | check if the string matches the format of a country's license plate.<br/><br/>`locale` is one of `['cs-CZ', 'de-DE', 'de-LI', 'en-IN', 'es-AR', 'hu-HU', 'pt-BR', 'pt-PT', 'sq-AL', 'sv-SE']` or `'any'`. | |||
**isLocale(str)** | check if the string is a locale. | |||
**isLowercase(str)** | check if the string is lowercase. | |||
**isLuhnValid(str)** | check if the string passes the [Luhn check][Luhn Check]. | |||
**isLuhnNumber(str)** | check if the string passes the [Luhn algorithm check](https://en.wikipedia.org/wiki/Luhn_algorithm). |
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.
**isLuhnNumber(str)** | check if the string passes the [Luhn algorithm check](https://en.wikipedia.org/wiki/Luhn_algorithm). | |
**isLuhnNumber(str)** | check if the string passes the [Luhn algorithm check][Luhn Check]. |
Line 300 already makes sure it links to that wikipedia page so this should be fine
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.
Doesn't affect the user so we can fix in a later PR as well
We did it, thanks folks! 🎉 |
13.9.0
New Features / Validators
isISO6391
: add ISO 639-1 validator @braaarisLuhnNumber
@ST-DDTFixes and Enhancements
#1865
isMACAddress
: add EUI-validation @WikiRik @tux-tn#1888
isBase32
: add option for Crockford's base32 alternative @BigOsvaap#1916
isDataURI
: fix mediaType format @temoffey#1920
isEmail
: addhost_whitelist
option @poor-coder#1939
isFQDN
: fixallow_numeric_tld
option @BigOsvaap#1962
isIP
: refactor @UnKnoWn-Consortium#1967
isLength
@ikkyu-3#1992
isMagnetURI
@Rhilip @tux-tn#1995
isURL
: fix check for host @mortbauer#2008
isCreditCard
@brianwhaley#2075
isAfter
: allow usage of option object @WikiRik#2114
isRgbColor
@pano9000#2122
isDataURI
: fix MIME types with underscores @pano9000#2148
isStrongPassword
@sandmule#2157
isISBN
: allow usage of option object @WikiRik#2170
isEmail
: fixignore_max_length
for FQDN @sakhmedbayev#2020
isFloat
: fix comma(,) passing as float @frederike-raminDocumentation fixes:
Code Refactors:
New and Improved Locales
isAlpha
,isAlphanumeric
:bn-BD
@rak810si-LK
@melkorCBAja-JP
@starcharlesko-KR
@DongkyuuuuisBIC
:XK
@import-brainisIdentityCard
:hk-HK
@DongkyuuuuisMobilePhone
:my-MM
, @ferdousulhaquede-DE
, @thomaschaafen-LS
, @DevilsAutumnel-CY
, @ikerasiotises-NI
, @ajGingrichaz-AZ
, @shaanaliyevir-IR
, @ArashST79ky-KG
, @arsalanfirooziar-YE
,ar-EH
,fa-AF
, @Mustafiz04ro-MD
, @mik7upar-YE
,en-BS
, @savannahvaithka-GE
, @avkvakpt-BR
, @jhcaiafa @matheusnascgomeses-HN
, @ademyan05nl-AW
, @adida948en-JM
, @ademyan05mn-MN
, @rksp25fr-BJ
, @rkuma552 @rksp25mg-MG
, @ShivangiRai1310en-PG
, @kai2128en-AG
, @jiaweilowen-AI
, @elaine1129en-KN
, @Eelyneeefr-CD
, @coolbeatz71en-SS
, @cheboidv-MV
, @pano9000en-HN
, @WikiRikar-KW
, @Yazan-KE @WikiRikel-GR
, @pano9000en-BM
, @pano9000ms-MY
, @pano9000ro-RO
, @pano9000isLicensePlate
:sv-SE
, @elmaxehu-HU
, @szabolcstarnaien-NI
, @NishantJSde-DE
, @bennetfabiande-DE
, @bennetfabianes-AR
, @alvarocastroisPassportNumber
:JM
,KZ
,LI
,NZ
@JuanFMLTH
@TonPC64 @braaarAZ
@djeks922PH
,PK
@digambar-t7isPostalCode
:BA
, @matheusnascgomesBY
, @pano9000IR
, @pano9000isTaxID
:en-CA
, @boonya'AT', 'BE', 'BG', 'HR', 'CY', 'CZ', 'DK', 'EE', 'FI', 'FR', 'DE', 'EL', 'HU', 'IE', 'LV', 'LT', 'LU', 'MT', 'PL', 'PT', 'RO', 'SK', 'SI', 'ES', 'SE', 'AL', 'MK', 'AU', 'BY', 'CA', 'IS', 'IN', 'ID', 'IL', 'KZ', 'NZ', 'NG', 'NO', 'PH', 'RU', 'SM', 'SA', 'RS', 'CH', 'TR', 'UA', 'UZ', 'AR', 'BO', 'BR', 'CL', 'CO', 'CR', 'EC', 'SV', 'GT', 'HN', 'MX', 'NI', 'PA', 'PY', 'PE', 'DO', 'UY', 'VE'
@Dev1lDragon