Skip to content

Commit 2a9a6ca

Browse files
committed
Fixed hungarian locale alphabet.
1 parent da8afcb commit 2a9a6ca

File tree

2 files changed

+37
-2
lines changed

2 files changed

+37
-2
lines changed

src/lib/alpha.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const alpha = {
55
'es-ES': /^[A-ZÁÉÍÑÓÚÜ]+$/i,
66
'fr-FR': /^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,
77
'nl-NL': /^[A-ZÉËÏÓÖÜ]+$/i,
8-
'hu-HU': /^[A-ZÁÉÓÖŐÚÜŰ]+$/i,
8+
'hu-HU': /^[A-ZÁÉÍÓÖŐÚÜŰ]+$/i,
99
'pl-PL': /^[A-ZĄĆĘŚŁŃÓŻŹ]+$/i,
1010
'pt-PT': /^[A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]+$/i,
1111
'ru-RU': /^[А-ЯЁа-яё]+$/i,
@@ -19,7 +19,7 @@ export const alphanumeric = {
1919
'de-DE': /^[0-9A-ZÄÖÜß]+$/i,
2020
'es-ES': /^[0-9A-ZÁÉÍÑÓÚÜ]+$/i,
2121
'fr-FR': /^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,
22-
'hu-HU': /^[0-9A-ZÁÉÓÖŐÚÜŰ]+$/i,
22+
'hu-HU': /^[0-9A-ZÁÉÍÓÖŐÚÜŰ]+$/i,
2323
'nl-NL': /^[0-9A-ZÉËÏÓÖÜ]+$/i,
2424
'pl-PL': /^[0-9A-ZĄĆĘŚŁŃÓŻŹ]+$/i,
2525
'pt-PT': /^[0-9A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]+$/i,

test/validators.js

+35
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,23 @@ describe('Validators', function () {
596596
});
597597
});
598598

599+
it('should validate hungarian alpha strings', function () {
600+
test({
601+
validator: 'isAlpha',
602+
args: ['hu-HU'],
603+
valid: [
604+
'árvíztűrőtükörfúrógép',
605+
'ÁRVÍZTŰRŐTÜKÖRFÚRÓGÉP',
606+
],
607+
invalid: [
608+
'äbc1',
609+
' fäö ',
610+
'Heiß',
611+
'',
612+
],
613+
});
614+
});
615+
599616
it('should validate arabic alpha strings', function () {
600617
test({
601618
validator: 'isAlpha',
@@ -724,6 +741,24 @@ describe('Validators', function () {
724741
});
725742
});
726743

744+
it('should validate hungarian alphanumeric strings', function () {
745+
test({
746+
validator: 'isAlphanumeric',
747+
args: ['hu-HU'],
748+
valid: [
749+
'0árvíztűrőtükörfúrógép123',
750+
'0ÁRVÍZTŰRŐTÜKÖRFÚRÓGÉP123',
751+
],
752+
invalid: [
753+
'1időúr!',
754+
'äbc1',
755+
' fäö ',
756+
'Heiß!',
757+
'',
758+
],
759+
});
760+
});
761+
727762
it('should validate spanish alphanumeric strings', function () {
728763
test({
729764
validator: 'isAlphanumeric',

0 commit comments

Comments
 (0)