alpha.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. 'use strict';
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. var alpha = exports.alpha = {
  6. 'en-US': /^[A-Z]+$/i,
  7. 'cs-CZ': /^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,
  8. 'de-DE': /^[A-ZÄÖÜß]+$/i,
  9. 'es-ES': /^[A-ZÁÉÍÑÓÚÜ]+$/i,
  10. 'fr-FR': /^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,
  11. 'nl-NL': /^[A-ZÉËÏÓÖÜ]+$/i,
  12. 'hu-HU': /^[A-ZÁÉÍÓÖŐÚÜŰ]+$/i,
  13. 'pl-PL': /^[A-ZĄĆĘŚŁŃÓŻŹ]+$/i,
  14. 'pt-PT': /^[A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]+$/i,
  15. 'ru-RU': /^[А-ЯЁ]+$/i,
  16. 'sr-RS@latin': /^[A-ZČĆŽŠĐ]+$/i,
  17. 'sr-RS': /^[А-ЯЂЈЉЊЋЏ]+$/i,
  18. 'tr-TR': /^[A-ZÇĞİıÖŞÜ]+$/i,
  19. ar: /^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/
  20. };
  21. var alphanumeric = exports.alphanumeric = {
  22. 'en-US': /^[0-9A-Z]+$/i,
  23. 'cs-CZ': /^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,
  24. 'de-DE': /^[0-9A-ZÄÖÜß]+$/i,
  25. 'es-ES': /^[0-9A-ZÁÉÍÑÓÚÜ]+$/i,
  26. 'fr-FR': /^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,
  27. 'hu-HU': /^[0-9A-ZÁÉÍÓÖŐÚÜŰ]+$/i,
  28. 'nl-NL': /^[0-9A-ZÉËÏÓÖÜ]+$/i,
  29. 'pl-PL': /^[0-9A-ZĄĆĘŚŁŃÓŻŹ]+$/i,
  30. 'pt-PT': /^[0-9A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]+$/i,
  31. 'ru-RU': /^[0-9А-ЯЁ]+$/i,
  32. 'sr-RS@latin': /^[0-9A-ZČĆŽŠĐ]+$/i,
  33. 'sr-RS': /^[0-9А-ЯЂЈЉЊЋЏ]+$/i,
  34. 'tr-TR': /^[0-9A-ZÇĞİıÖŞÜ]+$/i,
  35. ar: /^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/
  36. };
  37. var englishLocales = exports.englishLocales = ['AU', 'GB', 'HK', 'IN', 'NZ', 'ZA', 'ZM'];
  38. for (var locale, i = 0; i < englishLocales.length; i++) {
  39. locale = 'en-' + englishLocales[i];
  40. alpha[locale] = alpha['en-US'];
  41. alphanumeric[locale] = alphanumeric['en-US'];
  42. }
  43. alpha['pt-BR'] = alpha['pt-PT'];
  44. alphanumeric['pt-BR'] = alphanumeric['pt-PT'];
  45. // Source: http://www.localeplanet.com/java/
  46. var arabicLocales = exports.arabicLocales = ['AE', 'BH', 'DZ', 'EG', 'IQ', 'JO', 'KW', 'LB', 'LY', 'MA', 'QM', 'QA', 'SA', 'SD', 'SY', 'TN', 'YE'];
  47. for (var _locale, _i = 0; _i < arabicLocales.length; _i++) {
  48. _locale = 'ar-' + arabicLocales[_i];
  49. alpha[_locale] = alpha.ar;
  50. alphanumeric[_locale] = alphanumeric.ar;
  51. }