Skip to content

feat(isAlpha, isAlphanumeric): added support for Irish fadas (accents) #2281

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

Open
wants to merge 87 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
42d2012
added support for Irish fadas (accents) to isAlpha and isAlphanumeric
khoait Sep 6, 2023
332b501
fix(docs): misspelling of Mailto (#2368)
ZhulinskiiDanil Mar 5, 2024
4197b86
chore(isMailtoURI): remove unnecessary default to (#2341)
WikiRik Mar 5, 2024
31c88cf
fix(docs): fixed typo in README.md (#2371)
devmanbud Apr 25, 2024
6d5c52a
feat(isUUID): support uuid v7 (#2345)
ruscon Apr 25, 2024
752bd09
fix(isPassportNumber): fix regex Azerbaijan (#2284)
amaliacatalina Apr 25, 2024
0a100fe
feat(isAlpha, isAlphanumeric): add Esperanto (eo) locale (#2285)
RobinvanderVliet Apr 25, 2024
edb6b1c
fix(isPostalCode): improve Dutch postal code regex (#2271)
RobinvanderVliet Apr 25, 2024
b34a335
fix(isPort): Invalid leading zeros (#2208)
anasshakil Apr 25, 2024
32b174e
feat(isLicensePlate): Support for Pakistani vehicles (#2207)
anasshakil Apr 25, 2024
19f11cf
feat: added isAbaRouting validator (#2143)
songyuew Apr 25, 2024
6b3f62d
fix(isMobilePhone): fixed validation for am-AM (#2140)
AlexKrupko Apr 25, 2024
817e56e
ci: add latest node versions (#2364)
rubiin Apr 25, 2024
72c8dc1
fix(isPassport): added tests for ZA Passport Number (#2270)
GMorris-professional Apr 27, 2024
5677f91
fix: add SLE to the isISO4217 validator (#2273)
urg Apr 27, 2024
2253a77
chore: Publish to NPM with provenance (#2276)
meyfa Apr 27, 2024
8a40349
fix: symbolRegex in isStrongPassword to include '\' (#2278)
nandavikas Apr 27, 2024
11ac6a4
fix(isVAT): fixed KZ VAT number length check (#2279)
MatthieuLemoine Apr 27, 2024
d8c93d2
feat(isIBAN): add Algeria locale (#2320)
thibault-lr Apr 27, 2024
eacccaf
docs: move contributing guidelines to CONTRIBUTING.md (#2386)
alinaghale88 Apr 27, 2024
0836777
fix(isDate): hyphen before year is not allowed (#2381)
Sumit-tech-joshi Apr 27, 2024
43a0f09
feat(isTaxID): added TaxID for Ukraine uk-UA (#2358)
arttiger Apr 27, 2024
83d6ffd
fix(isVAT): improved ABN (AU VAT) validation (#2343)
matthewberryman Apr 27, 2024
cd4e7bf
13.12.0
profnandaa May 9, 2024
79f5d18
feat(isISO31661Numeric): Add validation for ISO 3166-1 numeric countr…
RobinvanderVliet May 10, 2024
189b259
doc: Update README.md for installation with other package managers
BibhushanKarki May 15, 2024
15e3738
feat: isMobilePhone en-GB enhance (#1971)
ihmpavel Jun 1, 2024
85a1f14
feat(isBtcAddress): :sparkles: Support all address formats and testne…
madoke Jun 1, 2024
e3a9db1
feat(isPhoneNumber): add guatemala, es-GT, locale (#2395)
ignaciosuarezquilis Jun 1, 2024
4bca6f0
docs: add Esperanto support to README.md (#2394)
RobinvanderVliet Jun 1, 2024
c25b98f
fix(isMobilePhone): update phone regex for Ukraine uk-UA (#2359)
arttiger Jun 1, 2024
806e55e
Merge pull request #2402 from BibhushanKarki/patch-1
rubiin Jun 1, 2024
28ff5d3
fix(isIBAN): narrow regex for VG (#2339)
ST-DDT Jun 1, 2024
21f33b6
chore: add license badges (#1732)
alguerocode Jun 1, 2024
a0acded
doc: add link to contributing and licence file (#2413)
rubiin Jun 3, 2024
fa6741a
chore: add rik and rubin as maintainers (#2408)
profnandaa Jun 3, 2024
316188d
doc: add reproduction section on bug_issue template (#2411)
rubiin Jun 3, 2024
f2bc5ed
feat(isISO4217): update iso4217 currency codes according to wiki (#2332)
cbodtorf Jun 4, 2024
08257b5
feat(isIdentityCard): add support for PK(Pakistan) (#2291)
Daniyal-Qureshi Jun 4, 2024
3448e9d
fix(isEmail): blacklist character check fix for #2392 (#2414)
keshavlingala Jun 4, 2024
d3db30d
docs: escape and unescape (#2325)
ovarn Jun 4, 2024
2b6b0fa
docs: Readme `isUUID` accepts also v7 (#2418)
ihmpavel Jun 13, 2024
acdebd6
fix: handle undefined and null values in isInt and isFloat (#2416)
Daniyal-Qureshi Jun 22, 2024
6e2f084
feat(isPostalCode): add validation for Colombian postal code (#2415)
jorgevrgs Jun 22, 2024
f73e3f2
fix: for #2403 get list of supported countries for passports (#2404)
derekparnell Jun 22, 2024
efd5b62
docs: fix typos (#2323)
ovarn Jun 22, 2024
0d6ca5a
fix: spell issues (#2423)
rubiin Jun 22, 2024
7d5ea2c
fix: remove bounty badge, no support (#2409)
profnandaa Jun 22, 2024
f81d857
feat(isRgbColor): add `allowSpaces` option to allow/disallow spaces b…
a-h-i Jun 22, 2024
89e856c
fix(isUUID): fully support rfc9562 (#2421)
broofa Jun 22, 2024
1f159ea
feat(ulid): ULID validation (#2294)
arafatkn Jun 23, 2024
542cfba
feat(isURL): add max_allowed_length option (#2439)
pinkiesky Aug 15, 2024
283a6a5
fix(isEmail): email starting with double quotes (#2437)
code0emperor Aug 15, 2024
72c4674
feat(isLicensePlate): added License Plate Regex for en-SG (#2333)
Sabarinathan07 Aug 15, 2024
f2b1082
fix: hard coded yandex domain conversion (#2441)
AayushGH Aug 24, 2024
96ff3b2
test(testFunctions): display stringified arguments in error message (…
pano9000 Aug 25, 2024
ff56dcf
fix(isDate): fix thrown error on certain invalid cases (#2443)
pano9000 Aug 25, 2024
66ddd9c
feat(isMobilePhone): add validation for Kyrgyzstan [ky-KG] mobile pho…
sadraliev Oct 1, 2024
12b27a2
feat(isLength): Fix linting and merge errors for #2019 (#2474)
Suven-p Oct 16, 2024
a513deb
Update phone regex for Zambia (#2482)
sonikishan Oct 27, 2024
fc31e6e
Disallow mismatching length for isDate (#2481)
sonikishan Oct 27, 2024
a066cd2
Assign check digit to 0 if remainder is 10 (#2492)
joelcuy Nov 12, 2024
def7f3e
feat(isMobilePhone): update phone regex for Ghana en-GH (#2362)
NanaAb-116 Nov 12, 2024
f54599c
refactor: make brazilian postal code separator optional (#2493)
ticmaisdev Nov 13, 2024
86911d8
feat(isEmail): allow regexp in host_whitelist and host_blacklist (#2494)
weikangchia Nov 21, 2024
a1e8476
fix(isIBAN): adjusting Ireland and Palestine IBAN regex (#2518)
Tarasz57 Jan 17, 2025
a7d5cff
feat(isPhoneNumber): add validation for Macedonian [mk-MK] phone num…
eshward95 Jan 30, 2025
a41c8de
feat: isISO15924 (#2215)
xDivisionByZerox Mar 16, 2025
b6dea02
fix(isMobilePhone): update Albanian phone number regex for valid form…
nichoola Mar 16, 2025
5e76a9f
release: 13.13.0 change log (#2536)
WikiRik Mar 24, 2025
a665f3c
13.15.0
profnandaa Mar 24, 2025
f5da7fb
fix: right version in CHANGELOG 13.13.0 -> 13.15.0
profnandaa Mar 24, 2025
ac3d50a
feat(isIP): allow usage of options object (#2089)
pixelbucket-dev Mar 26, 2025
7ab06c4
fix(isPassportNumber): improve CA locale (#2526)
evanbechtol Mar 26, 2025
7ff247d
feat(isBase64): improve validation based on RFC4648 (#2491)
aseyfpour Mar 26, 2025
c174a1f
fix(isPostalCode): improve `FR` locale (#2479)
Rajput-Balram Mar 26, 2025
650a2fa
feat(isBefore): allow usage of options object (#2088)
pixelbucket-dev Mar 27, 2025
a18d57d
Allow second digit in rgba alpha value (#2346)
controlol Mar 27, 2025
ab18093
fix(isMobilePhone): improve `el-CY` locale (#2514)
rezk2ll Mar 27, 2025
aacf9b5
chore: make ddd optional and update phone number format (#2512)
renaldodev Mar 27, 2025
2866bb1
feat(isTime) add withOptionalSeconds option (#2521)
greenbea Mar 27, 2025
055559d
fix(isMobilePhone): improve `ar-OM` locale (#2502)
tomcastro Mar 27, 2025
b610a88
Refactor assertString: Faster, less nested and more consistent. (#2372)
EmersonRabelo Mar 28, 2025
90c19e8
fix(isIP): improve IPv6 regex (#2453)
ShreySinha02 Mar 28, 2025
616f5b8
added support for Irish fadas (accents) to isAlpha and isAlphanumeric
khoait Sep 6, 2023
7478af1
resolved conflicts
khoait Mar 29, 2025
437456d
delete slnx.sqlite
khoait Mar 29, 2025
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
4 changes: 2 additions & 2 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', 'kk-KZ', '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', 'kk-KZ', '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.
**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', 'ga-IE', 'he', 'hi-IN', 'hu-HU', 'it-IT', 'kk-KZ', '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', 'ga-IE', 'he', 'hi-IN', 'hu-HU', 'it-IT', 'kk-KZ', '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
2 changes: 2 additions & 0 deletions src/lib/alpha.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const alpha = {
'fa-IR': /^[ابپتثجچحخدذرزژسشصضطظعغفقکگلمنوهی]+$/i,
'fi-FI': /^[A-ZÅÄÖ]+$/i,
'fr-FR': /^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,
'ga-IE': /^[A-ZÁÉÍÓÚ]+$/i,
'it-IT': /^[A-ZÀÉÈÌÎÓÒÙ]+$/i,
'ja-JP': /^[ぁ-んァ-ヶヲ-゚一-龠ー・。、]+$/i,
'nb-NO': /^[A-ZÆØÅ]+$/i,
Expand Down Expand Up @@ -50,6 +51,7 @@ export const alphanumeric = {
'es-ES': /^[0-9A-ZÁÉÍÑÓÚÜ]+$/i,
'fi-FI': /^[0-9A-ZÅÄÖ]+$/i,
'fr-FR': /^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,
'ga-IE': /^[0-9A-ZÁÉÍÓÚ]+$/i,
'it-IT': /^[0-9A-ZÀÉÈÌÎÓÒÙ]+$/i,
'ja-JP': /^[0-90-9ぁ-んァ-ヶヲ-゚一-龠ー・。、]+$/i,
'hu-HU': /^[0-9A-ZÁÉÍÓÖŐÚÜŰ]+$/i,
Expand Down
41 changes: 41 additions & 0 deletions test/validators.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2048,6 +2048,26 @@ describe('Validators', () => {
});
});

it('should validate Irish alpha strings', () => {
test({
validator: 'isAlpha',
args: ['ga-IE'],
valid: [
'Éire',
'Císte',
'Seán',
'Réabhlóidithe',
'ceiliúradh',
'Buachaill',
],
invalid: [
'Éire1',
' Císte ',
'123',
],
});
});

it('should error on invalid locale', () => {
test({
validator: 'isAlpha',
Expand Down Expand Up @@ -2735,6 +2755,27 @@ describe('Validators', () => {
});
});

it('should validate Irish alphanumeric strings', () => {
test({
validator: 'isAlphanumeric',
args: ['ga-IE'],
valid: [
'Éire123',
'4Císte',
'S5eán',
'Réabhlóidithe',
'ceiliúradh',
'Buachaill',
'678',
],
invalid: [
'Éire 1',
' Císte 2 ',
'123!',
],
});
});

it('should error on invalid locale', () => {
test({
validator: 'isAlphanumeric',
Expand Down