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

maintenance: release 2301 prep - v13.9.0 #2166

Closed
wants to merge 154 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
154 commits
Select commit Hold shift + click to select a range
58cc918
feat: added support for Bengali language
May 27, 2021
74ea0fb
removed local changes
May 27, 2021
5e1c0cd
feat(isMobilePhone): add my-MM locale (#1813)
ferdousulhaque Nov 17, 2021
667b0bf
fix(docs): add missing options synthax on isISO8601 validator (#1860)
leonardovillela Nov 17, 2021
9c12b4c
fix(isMobilePhone): update de-DE regex to exclude landline numbers (#…
thomaschaaf Nov 17, 2021
f055c11
feat(isMACAddress): add EUI-64 validation (#1865)
WikiRik Nov 17, 2021
42ecd6c
Changes Made in Branch
rak810 Nov 17, 2021
9cfd06a
feat: (isMobilePhone) add Cyprus validation
ikerasiotis Jan 19, 2022
7c396cc
feat (isMobilePhone): add Nicaragua validator
ajGingrich Jan 20, 2022
23d94ae
add back trailing space to readme
ajGingrich Jan 20, 2022
c194bda
Add Iran phone number
ArashST79 Feb 3, 2022
72f5b25
Update isMobilePhone.js
arsalanfiroozi Feb 4, 2022
aa07a24
Update validators.js
arsalanfiroozi Feb 4, 2022
843240f
Update README.md
arsalanfiroozi Feb 4, 2022
fba9680
Added isMobilePhone valid regex for Afghanistan, Yemen and Western Sa…
Mustafiz04 Feb 5, 2022
ff4cdfe
docs: add a security policy (#1861)
tux-tn Feb 17, 2022
2fad8ab
feat(isLicensePlate): add support for Swedish license plates (#1665)
elmaxe Feb 17, 2022
4ee1655
feat(isTaxID): Canadian Social Insurance Number (SIN) validator (#1867)
boonya Feb 17, 2022
c1b21a9
chore(maintainers): update list of maintainers (#1887)
ezkemboi Feb 17, 2022
c605fe6
fix: option allow_numeric_tld option in isFQDN
BigOsvaap Mar 13, 2022
3d7fd6a
feat(isMobilePhone): Added regex for Bahamas - en-BS
savannahvaith Mar 15, 2022
3cf0f84
refactor: replace deprecated String.prototype.substr()
CommanderRoot Mar 20, 2022
a51103c
en-IN and all india locale support for isLicensePlate
NishantJS Mar 22, 2022
3d4d04a
Updated German license plate regex
bennetfabian Mar 25, 2022
290debb
Also removed old regex
bennetfabian Mar 25, 2022
924f3bc
Removed obsolete alternation in German regex
bennetfabian Mar 25, 2022
080f7df
Added more DE license plate tests
bennetfabian Mar 25, 2022
1bb491c
Fix fi-FI mobile phone number format to support 050xxxx numbers
rapaantti Mar 28, 2022
70b028e
fix phone numner validation for ka-GE locale
Apr 1, 2022
b415ade
update regexp
Apr 1, 2022
cf8dcea
feat(isBase32): Add option for Crockford's base 32 alternative (#1888)
BigOsvaap Apr 22, 2022
b039202
feat(isISO6391): add ISO 639-1 validator (#1892)
braaar Apr 22, 2022
495a175
feat(isMobilePhone): add Lesotho, en-LS locale (#1896)
DevilsAutumn Apr 22, 2022
4b8eac5
fix(isMobilePhone): update az-AZ (#1910)
seabeya Apr 22, 2022
066869c
fix(isDataURI): fix dataURI mediaType format (#1916)
temoffey Apr 22, 2022
cfcf911
chore: add code scan (#1859)
profnandaa Apr 22, 2022
9055591
Update isMobilePhone.js for pt-BR
jhcaiafa May 10, 2022
913d75c
Update validator.js - pt-BR test for isMobilePhone
jhcaiafa May 10, 2022
95345ae
fix(isLength) added process to subtract Presentation Sequences charac…
ikkyu-3 May 15, 2022
2e52efe
refactor(isIP): removed redundant check for IPv4 addresses
UnKnoWn-Consortium May 16, 2022
d9896ca
feat(isLuhnValid): Expose isLuhnValid independently from isCreditCard
ST-DDT May 22, 2022
4098467
test: add tests specifically for isLuhnValid
ST-DDT May 23, 2022
61ee147
feat(isMobilePhone): Added regex for Mongolia mn-MN
Jun 11, 2022
d88c7b6
fix(Honduras_enhancement): added the correct regex for phone numbers …
ademyan05 Jun 11, 2022
4758af0
Merge pull request #1 from rkuma552/feature/add-country-tophone
Jun 11, 2022
68ea9c4
Merge pull request #1 from ademyan05/fix/Honduras_enhancement
ademyan05 Jun 11, 2022
2a26c9f
feat(Jamaica-addition): added en-JM to isMobilePhone.js
ademyan05 Jun 13, 2022
7786bb3
feat(jamaica-addition): cleaned the branch
ademyan05 Jun 13, 2022
2280ff1
Revert "fix(Honduras_enhancement): added the correct regex for phone …
ademyan05 Jun 13, 2022
d50c860
"fix(Honduras_enhancement): added the correct regex for phone numbers…
ademyan05 Jun 13, 2022
61c9a1c
Update validators.js
Dev1lDragon Jun 16, 2022
bcac756
Update README.md
Dev1lDragon Jun 24, 2022
73098eb
feat(isMobilePhone): Added regex for Mongolia mn-MN (#1993)
rksp25 Jun 30, 2022
47443d1
fix: Modify pattern of pt-Br regex (#1951)
matheusnascgomes Jun 30, 2022
97d992c
fix(isPostalCode): update bosnian, BA locale (#1956)
zlayabekrija Jun 30, 2022
9a0bb35
fix(matches): prevent regex state from breaking following validations…
fedeci Jun 30, 2022
0175670
feat(isMagnetURI): support Bittorrent v2 (#1992)
Rhilip Jun 30, 2022
37cbd5c
fix(docs): missing SK locale isPostalCode (#1957)
tfilo Jun 30, 2022
5d2ff83
do not check if the host is valid if no host is specified
mortbauer Jul 2, 2022
6fb8bb5
feat(isMobilePhone): Added regex for Aruba nl-AW (#1985)
adida948 Jul 3, 2022
4767c21
feat(isMobilePhone): Added regex for Benin fr-BJ
Jul 4, 2022
2942078
Add Sinhala(si-LK) language support
Jul 5, 2022
12c82b9
Merge branch 'master' into feature/add-country-benin
rksp25 Jul 5, 2022
f219330
feat(isPassportNumber): add regex for mexico
samilieberman Jul 5, 2022
25c1504
feat(madagascar): regex added for madagascar mg-MG
Jul 13, 2022
4bf55e4
Merge pull request #2001 from ShivangiRai1310/feat/madagascar
rubiin Jul 17, 2022
d5f8015
Merge pull request #1998 from samilieberman/feat/mexico
rubiin Jul 17, 2022
9f89f3b
Merge pull request #1995 from mortbauer/fix/isURL-empty-host-with-query
rubiin Jul 17, 2022
fdbb1ee
Merge pull request #1996 from melkorCBA/master
rubiin Jul 17, 2022
c6ecf53
Merge pull request #1983 from ademyan05/master
rubiin Jul 17, 2022
2f26bac
Merge pull request #1942 from CommanderRoot/rm-deprecated-substr
rubiin Jul 17, 2022
c57ff39
Merge pull request #1974 from ST-DDT/expose/luhnCheck
rubiin Jul 17, 2022
8f04ca9
Merge pull request #1939 from BigOsvaap/fix-isFQDN-allow_numeric_tld-…
rubiin Jul 17, 2022
ceeb7b2
feat: added Papua New Guinea mobile number validation
kai2128 Jul 17, 2022
625603d
Merge branch 'master' into feature/add-country-benin
rksp25 Jul 17, 2022
ccf4170
Merge pull request #2002 from kai2128/master
rubiin Jul 18, 2022
8233ff1
Merge pull request #1946 from rapaantti/is-mobile-phone-finnish-numbers
rubiin Jul 18, 2022
49c3abe
Merge pull request #1967 from ikkyu-3/master
rubiin Jul 18, 2022
46118dc
Merge pull request #1944 from NishantJS/master
rubiin Jul 18, 2022
eaca48e
Merge pull request #1945 from bennetfabian/update/de-licenseplates
rubiin Jul 18, 2022
518a663
Merge pull request #1969 from UnKnoWn-Consortium/refactor-isip
rubiin Jul 18, 2022
4096915
Merge branch 'master' into feature/add-country-benin
rksp25 Jul 18, 2022
a17421a
Merge pull request #1997 from rksp25/feature/add-country-benin
rubiin Jul 18, 2022
7b8149b
feat(isMobilePhone): added Antigua and Barbuda mobile number validati…
jiaweilow Jul 19, 2022
ed3d8a4
Merge pull request #2004 from jiaweilow/master
rubiin Jul 19, 2022
356f055
Merge branch 'master' into patch-1
rubiin Jul 19, 2022
e483f6a
Merge pull request #1964 from jhcaiafa/patch-1
rubiin Jul 19, 2022
374a0b7
Merge branch 'master' into master
rubiin Jul 19, 2022
c8c247c
Merge pull request #1924 from arsalanfiroozi/master
rubiin Jul 19, 2022
678e55b
Merge pull request #1952 from avkvak/ka-ge-phone-regex-fix
rubiin Jul 19, 2022
222cacc
Merge branch 'master' into master
rubiin Jul 19, 2022
c193fe5
Merge pull request #1922 from ArashST79/master
rubiin Jul 19, 2022
afdbd68
Merge branch 'master' into feature/all-country-regex
rubiin Jul 19, 2022
89949e7
Merge pull request #1925 from Mustafiz04/feature/all-country-regex
rubiin Jul 19, 2022
a14f4de
Merge branch 'master' into feat/1761-mobile-phone-validation
rubiin Jul 19, 2022
aead076
Merge pull request #1940 from savannahvaith/feat/1761-mobile-phone-va…
rubiin Jul 19, 2022
f2d7e04
Merge branch 'master' into nicaragua-phone
rubiin Jul 19, 2022
edce476
Merge pull request #1909 from ajGingrich/nicaragua-phone
rubiin Jul 19, 2022
da1a936
Merge branch 'master' into master
rubiin Jul 19, 2022
3873ebf
Merge pull request #1897 from ikerasiotis/master
rubiin Jul 19, 2022
c7c0760
Merge branch 'master' into master
rubiin Jul 19, 2022
35b5ffb
Merge pull request #1678 from rak810/master
rubiin Jul 19, 2022
7832d4a
Merge pull request #1989 from Dev1lDragon/patch-1
rubiin Jul 19, 2022
35fc280
Merge branch 'master' into feat/Jamaica-addition
rubiin Jul 19, 2022
450a2c0
Merge pull request #1986 from ademyan05/feat/Jamaica-addition
rubiin Jul 19, 2022
1bb14e8
feat(isMobilePhone): added Anguilla, en-AI, locale (#2007)
elaine1129 Jul 23, 2022
2d70100
Fix broken Validators table at README.md
marcelozarate Jul 27, 2022
86a07ba
Merge pull request #2010 from marcelozarate/patch-1
rubiin Aug 6, 2022
e143430
Remove 'Changes made' from README
WikiRik Aug 10, 2022
edf445a
feat(isPassportNumber): add passport number of thailand, TH (#1814)
TonPC64 Oct 17, 2022
c1d1b48
feat(isEmail): add whitelist host to isEmail validation (#1920)
poor-cooder Oct 17, 2022
ee33432
feat(isCreditCard): enhancements (#2008)
brianwhaley Oct 17, 2022
2c785a5
feat(isMobilePhone): added Saint Kitts and Nevis locale, en-KN (#2011)
Eelyneee Oct 17, 2022
d698f4f
feat(isAlpha, isAlphanumeric): add japanese locale, ja-JP (#2014)
starcharles Oct 17, 2022
7b47f53
feat(isAlpha, isAlphanumeric): add ko-KR locale (#1965)
Dongkyuuuu Oct 17, 2022
531dc7f
Merge pull request #2024 from WikiRik/patch-1
rubiin Oct 19, 2022
93667bd
chore(CodeQL): update deprecated v1 to v2 (#2150)
pano9000 Jan 19, 2023
c19777a
feat(isIdentityCard): add hk-HK locale (#2142)
songyuew Jan 20, 2023
41c7a16
feat(isMobilePhone): add south sudan locale, en-SS (#2084)
cheboi Jan 22, 2023
ee81073
fix(isStrongPassword): add £ as symbol (#2148)
sandmule Jan 22, 2023
cca678a
fix(isMobilePhone): added extra prefix for ar-KW locale (#2138)
Yazan-KE Jan 22, 2023
f394da0
test(validators): remove duplicated test (#2137)
pano9000 Jan 22, 2023
394eebf
fix(isPostalCode): fix overly permissive IR regexp (#2136)
pano9000 Jan 22, 2023
dcb6cb6
refactor(isBtcAddress): get rid of unnecessary if statement and comme…
pano9000 Jan 22, 2023
d8f3a24
fix(isMobilePhone): re-add es-HN fix from #1983 (#2129)
WikiRik Jan 22, 2023
a571b3e
fix(isDataURI): fix MIME types with underscores not getting matched …
pano9000 Jan 22, 2023
44224d7
fix(isMobilePhone): fix el-GR validation - add missing ranges and cor…
pano9000 Jan 22, 2023
8e004e0
added isTime validator (#1479)
francoatmega Jan 22, 2023
7bef722
fix(isPostalCode): fix overly permissive BY regexp (#2134)
pano9000 Jan 22, 2023
35b1fc1
refactor: change test files to prepare for #1874 (#2091)
WikiRik Jan 28, 2023
f97e8d4
fix(docs): remove duplicated "New Features" section in CHANGELOG (#2118)
pano9000 Jan 28, 2023
d25559b
fix(isMobilePhone): fix wrong dv-MV mobile phone matching (issue #210…
pano9000 Jan 29, 2023
0586d23
docs: Improve consistency and fix errors in README.md (#2107)
pano9000 Jan 29, 2023
8deae54
fix(isLicensePlate): remove duplicate char from character class (#2085)
pedroprado010 Jan 29, 2023
c332e5c
fix(isMimeType): Fix MIME Types with underscores not getting matched …
pano9000 Jan 29, 2023
d61322c
fix(isMobilePhone): fix 'ro-RO' matching invalid numbers (#2156)
pano9000 Jan 29, 2023
f9d49fc
fix(isMobilePhone): fix 'ms-MY' regexp (#2155)
pano9000 Jan 29, 2023
c81df18
fix(isMobilePhone): Fix en-BM matching invalid numbers due to missing…
pano9000 Jan 29, 2023
b2a999d
fix(isRgbColor): fix validation of rgb(a) ColorPercentage strings (#2…
pano9000 Jan 29, 2023
753c29d
feat(isAfter): allow usage of options object (#2075)
WikiRik Jan 29, 2023
6dba289
feat(isISBN): allow usage of options object (#2157)
WikiRik Jan 30, 2023
8604748
feat(isPassportNumber): new locales JM,KZ,LI,NZ
profnandaa Jan 31, 2023
427b035
feat(isLicensePlate): add hu-HU locale (#2165)
profnandaa Jan 31, 2023
bde420b
feat(isMobilePhone): add ro-MD locale (#2167)
profnandaa Jan 31, 2023
5bb8c91
feat:(isMobilePhone): add fr-CD, DR Congo locale (#2168)
profnandaa Jan 31, 2023
a310168
feat(isLicensePlate): add es-AR locale (#2169)
profnandaa Jan 31, 2023
b489355
fix(isEmail): fixed `isFQDN`'s `ignore_max_length` check (#2170)
profnandaa Feb 1, 2023
31a74d5
feat(isPassportNumber): add PH and PK locales (#2172)
profnandaa Feb 2, 2023
58f4b13
feat(isPassportNumber): add regex for AZ locale (#2173)
profnandaa Feb 2, 2023
c6f2196
fix(isFloat): fix comma passing as float (#2174)
profnandaa Feb 2, 2023
91c8bd9
Merge pull request #2164 from validatorjs/mcfix/combined-prs
profnandaa Feb 2, 2023
a8e0005
fix(isBIC): add `XK` to accepted BIC country codes (#2046)
import-brain Feb 2, 2023
d423220
fix: few pre-release fixes
profnandaa Feb 2, 2023
54d330c
13.9.0
profnandaa Feb 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ Validator | Description
**contains(str, seed [, options])** | check if the string contains the seed.<br/><br/>`options` is an object that defaults to `{ ignoreCase: false, minOccurrences: 1 }`.<br />Options: <br/> `ignoreCase`: Ignore case when doing comparison, default false.<br/>`minOccurences`: Minimum number of occurrences for the seed in the string. Defaults to 1.
**equals(str, comparison)** | check if the string matches the comparison.
**isAfter(str [, options])** | check if the string is a date that is after the specified date.<br/><br/>`options` is an object that defaults to `{ comparisonDate: Date().toString() }`.<br/>**Options:**<br/>`comparisonDate`: Date to compare to. Defaults to `Date().toString()` (now).
**isAlpha(str [, locale, options])** | check if the string contains only letters (a-zA-Z).<br/><br/>`locale` is one of `['ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-QA', 'ar-QM', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'bg-BG', 'bn', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', 'en-AU', 'en-GB', 'en-HK', 'en-IN', 'en-NZ', 'en-US', 'en-ZA', 'en-ZM', 'es-ES', 'fa-IR', 'fi-FI', 'fr-CA', 'fr-FR', 'he', 'hi-IN', 'hu-HU', 'it-IT', 'ko-KR', 'ja-JP', 'ku-IQ', 'nb-NO', 'nl-NL', 'nn-NO', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'si-LK', 'sl-SI', 'sk-SK', 'sr-RS', 'sr-RS@latin', 'sv-SE', 'tr-TR', 'uk-UA']` and defaults to `en-US`. Locale list is `validator.isAlphaLocales`. `options` is an optional object that can be supplied with the following key(s): `ignore` which can either be a String or RegExp of characters to be ignored e.g. " -" will ignore spaces and -'s.
**isAlphanumeric(str [, locale, options])** | check if the string contains only letters and numbers (a-zA-Z0-9).<br/><br/>`locale` is one of `['ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-QA', 'ar-QM', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'bn', 'bg-BG', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', 'en-AU', 'en-GB', 'en-HK', 'en-IN', 'en-NZ', 'en-US', 'en-ZA', 'en-ZM', 'es-ES', 'fa-IR', 'fi-FI', 'fr-CA', 'fr-FR', 'he', 'hi-IN', 'hu-HU', 'it-IT', 'ko-KR', 'ja-JP','ku-IQ', 'nb-NO', 'nl-NL', 'nn-NO', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'si-LK', 'sl-SI', 'sk-SK', 'sr-RS', 'sr-RS@latin', 'sv-SE', 'tr-TR', 'uk-UA']`) and defaults to `en-US`. Locale list is `validator.isAlphanumericLocales`. `options` is an optional object that can be supplied with the following key(s): `ignore` which can either be a String or RegExp of characters to be ignored e.g. " -" will ignore spaces and -'s.
**isAlpha(str [, locale, options])** | check if the string contains only letters (a-zA-Z).<br/><br/>`locale` is one of `['ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-QA', 'ar-QM', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'bg-BG', 'bn', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', 'en-AU', 'en-GB', 'en-HK', 'en-IN', 'en-NZ', 'en-US', 'en-ZA', 'en-ZM', 'es-ES', 'fa-IR', 'fi-FI', 'fr-CA', 'fr-FR', 'he', 'hi-IN', 'hu-HU', 'it-IT', 'ko-KR', 'ja-JP', 'ku-IQ', 'nb-NO', 'nl-NL', 'nn-NO', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'si-LK', 'sl-SI', 'sk-SK', 'sr-RS', 'sr-RS@latin', 'sv-SE', 'th-TH', 'tr-TR', 'uk-UA']` and defaults to `en-US`. Locale list is `validator.isAlphaLocales`. `options` is an optional object that can be supplied with the following key(s): `ignore` which can either be a String or RegExp of characters to be ignored e.g. " -" will ignore spaces and -'s.
**isAlphanumeric(str [, locale, options])** | check if the string contains only letters and numbers (a-zA-Z0-9).<br/><br/>`locale` is one of `['ar', 'ar-AE', 'ar-BH', 'ar-DZ', 'ar-EG', 'ar-IQ', 'ar-JO', 'ar-KW', 'ar-LB', 'ar-LY', 'ar-MA', 'ar-QA', 'ar-QM', 'ar-SA', 'ar-SD', 'ar-SY', 'ar-TN', 'ar-YE', 'bn', 'bg-BG', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', 'en-AU', 'en-GB', 'en-HK', 'en-IN', 'en-NZ', 'en-US', 'en-ZA', 'en-ZM', 'es-ES', 'fa-IR', 'fi-FI', 'fr-CA', 'fr-FR', 'he', 'hi-IN', 'hu-HU', 'it-IT', 'ko-KR', 'ja-JP','ku-IQ', 'nb-NO', 'nl-NL', 'nn-NO', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'si-LK', 'sl-SI', 'sk-SK', 'sr-RS', 'sr-RS@latin', 'sv-SE', 'th-TH', 'tr-TR', 'uk-UA']`) and defaults to `en-US`. Locale list is `validator.isAlphanumericLocales`. `options` is an optional object that can be supplied with the following key(s): `ignore` which can either be a String or RegExp of characters to be ignored e.g. " -" will ignore spaces and -'s.
**isAscii(str)** | check if the string contains ASCII chars only.
**isBase32(str [, options])** | check if the string is base32 encoded. `options` is optional and defaults to `{ crockford: false }`.<br/> When `crockford` is true it tests the given base32 encoded string using [Crockford's base32 alternative][Crockford Base32].
**isBase58(str)** | check if the string is base58 encoded.
Expand Down Expand Up @@ -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).
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
**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

Copy link
Member

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

**isMACAddress(str [, options])** | check if the string is a MAC address.<br/><br/>`options` is an object which defaults to `{ no_separators: false }`. If `no_separators` is true, the validator will allow MAC addresses without separators. Also, it allows the use of hyphens, spaces or dots e.g. '01 02 03 04 05 ab', '01-02-03-04-05-ab' or '0102.0304.05ab'. The options also allow a `eui` property to specify if it needs to be validated against EUI-48 or EUI-64. The accepted values of `eui` are: 48, 64.
**isMagnetURI(str)** | check if the string is a [Magnet URI format][Magnet URI Format].
**isMD5(str)** | check if the string is a MD5 hash.<br/><br/>Please note that you can also use the `isHash(str, 'md5')` function. Keep in mind that MD5 has some collision weaknesses compared to other algorithms (e.g., SHA).
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ import isBefore from './lib/isBefore';

import isIn from './lib/isIn';

import isLuhnValid from './lib/isLuhnValid';
import isLuhnNumber from './lib/isLuhnNumber';
import isCreditCard from './lib/isCreditCard';
import isIdentityCard from './lib/isIdentityCard';

Expand Down Expand Up @@ -185,7 +185,7 @@ const validator = {
isAfter,
isBefore,
isIn,
isLuhnValid,
isLuhnNumber,
isCreditCard,
isIdentityCard,
isEAN,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/isCreditCard.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import assertString from './util/assertString';
import isLuhnValid from './isLuhnValid';
import isLuhnValid from './isLuhnNumber';

const cards = {
amex: /^3[47][0-9]{13}$/,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/isLuhnValid.js → src/lib/isLuhnNumber.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import assertString from './util/assertString';

export default function isLuhnValid(str) {
export default function isLuhnNumber(str) {
assertString(str);
const sanitized = str.replace(/[- ]+/g, '');
let sum = 0;
Expand Down
2 changes: 1 addition & 1 deletion test/validators.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5215,7 +5215,7 @@ describe('Validators', () => {

it('should validate luhn numbers', () => {
test({
validator: 'isLuhnValid',
validator: 'isLuhnNumber',
valid: [
'0',
'5421',
Expand Down