Skip to content

Commit

Permalink
Merge pull request #541 from ojji/master
Browse files Browse the repository at this point in the history
Fixed hungarian locale alphabet.
  • Loading branch information
chriso authored Jun 14, 2016
2 parents da8afcb + 2a9a6ca commit 5e9bab1
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/alpha.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const alpha = {
'es-ES': /^[A-ZÁÉÍÑÓÚÜ]+$/i,
'fr-FR': /^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,
'nl-NL': /^[A-ZÉËÏÓÖÜ]+$/i,
'hu-HU': /^[A-ZÁÉÓÖŐÚÜŰ]+$/i,
'hu-HU': /^[A-ZÁÉÍÓÖŐÚÜŰ]+$/i,
'pl-PL': /^[A-ZĄĆĘŚŁŃÓŻŹ]+$/i,
'pt-PT': /^[A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]+$/i,
'ru-RU': /^[А-ЯЁа-яё]+$/i,
Expand All @@ -19,7 +19,7 @@ export const alphanumeric = {
'de-DE': /^[0-9A-ZÄÖÜß]+$/i,
'es-ES': /^[0-9A-ZÁÉÍÑÓÚÜ]+$/i,
'fr-FR': /^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,
'hu-HU': /^[0-9A-ZÁÉÓÖŐÚÜŰ]+$/i,
'hu-HU': /^[0-9A-ZÁÉÍÓÖŐÚÜŰ]+$/i,
'nl-NL': /^[0-9A-ZÉËÏÓÖÜ]+$/i,
'pl-PL': /^[0-9A-ZĄĆĘŚŁŃÓŻŹ]+$/i,
'pt-PT': /^[0-9A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]+$/i,
Expand Down
35 changes: 35 additions & 0 deletions test/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,23 @@ describe('Validators', function () {
});
});

it('should validate hungarian alpha strings', function () {
test({
validator: 'isAlpha',
args: ['hu-HU'],
valid: [
'árvíztűrőtükörfúrógép',
'ÁRVÍZTŰRŐTÜKÖRFÚRÓGÉP',
],
invalid: [
'äbc1',
' fäö ',
'Heiß',
'',
],
});
});

it('should validate arabic alpha strings', function () {
test({
validator: 'isAlpha',
Expand Down Expand Up @@ -724,6 +741,24 @@ describe('Validators', function () {
});
});

it('should validate hungarian alphanumeric strings', function () {
test({
validator: 'isAlphanumeric',
args: ['hu-HU'],
valid: [
'0árvíztűrőtükörfúrógép123',
'0ÁRVÍZTŰRŐTÜKÖRFÚRÓGÉP123',
],
invalid: [
'1időúr!',
'äbc1',
' fäö ',
'Heiß!',
'',
],
});
});

it('should validate spanish alphanumeric strings', function () {
test({
validator: 'isAlphanumeric',
Expand Down

0 comments on commit 5e9bab1

Please sign in to comment.