Skip to content

Commit 5c37ed5

Browse files
alphaNumeric Tests for indic locales and Sorted Locales
1 parent c458883 commit 5c37ed5

4 files changed

Lines changed: 248 additions & 56 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ Validator | Description
8888
**equals(str, comparison)** | check if the string matches the comparison.
8989
**isAbaRouting(str)** | check if the string is an ABA routing number for US bank account / cheque.
9090
**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).
91-
**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', 'eo', 'es-ES', 'fa-IR', 'fi-FI', 'fr-CA', 'fr-FR', 'he', 'hi-IN', 'ta-IN', 'te-IN', 'kn-IN', 'ml-IN', 'gu-IN', 'pa-IN', 'or-IN', 'bn-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.
92-
**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', 'eo', 'es-ES', 'fa-IR', 'fi-FI', 'fr-CA', 'fr-FR', 'he', 'hi-IN', 'ta-IN', 'te-IN', 'kn-IN', 'ml-IN', 'gu-IN', 'pa-IN', 'or-IN', 'bn-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.
91+
**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', 'bn-IN', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', 'en-AU', 'en-GB', 'en-HK', 'en-IN', 'en-NZ', 'en-US', 'en-ZA', 'en-ZM', 'eo', 'es-ES', 'fa-IR', 'fi-FI', 'fr-CA', 'fr-FR', 'gu-IN', 'he', 'hi-IN', 'hu-HU', 'it-IT', 'ja-JP', 'kk-KZ', 'kn-IN', 'ko-KR', 'ku-IQ', 'ml-IN', 'nb-NO', 'nl-NL', 'nn-NO', 'or-IN', 'pa-IN', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'si-LK', 'sk-SK', 'sl-SI', 'sr-RS', 'sr-RS@latin', 'sv-SE', 'ta-IN', 'te-IN', '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.
92+
**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', 'bg-BG', 'bn', 'bn-IN', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', 'en-AU', 'en-GB', 'en-HK', 'en-IN', 'en-NZ', 'en-US', 'en-ZA', 'en-ZM', 'eo', 'es-ES', 'fa-IR', 'fi-FI', 'fr-CA', 'fr-FR', 'gu-IN', 'he', 'hi-IN', 'hu-HU', 'it-IT', 'ja-JP', 'kk-KZ', 'kn-IN', 'ko-KR', 'ku-IQ', 'ml-IN', 'nb-NO', 'nl-NL', 'nn-NO', 'or-IN', 'pa-IN', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'si-LK', 'sk-SK', 'sl-SI', 'sr-RS', 'sr-RS@latin', 'sv-SE', 'ta-IN', 'te-IN', '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.
9393
**isAscii(str)** | check if the string contains ASCII chars only.
9494
**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].
9595
**isBase58(str)** | check if the string is base58 encoded.

npm-debug.log

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
0 info it worked if it ends with ok
2+
1 verbose cli [
3+
1 verbose cli 'C:\\nvm4w\\nodejs\\node.exe',
4+
1 verbose cli 'C:\\Users\\avado\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
5+
1 verbose cli 'install',
6+
1 verbose cli '-g',
7+
1 verbose cli 'npm'
8+
1 verbose cli ]
9+
2 info using npm@3.10.10
10+
3 info using node@v24.4.1
11+
4 silly loadCurrentTree Starting
12+
5 silly install loadCurrentTree
13+
6 silly install readGlobalPackageData
14+
7 silly fetchPackageMetaData npm
15+
8 silly fetchNamedPackageData npm
16+
9 silly mapToRegistry name npm
17+
10 silly mapToRegistry using default registry
18+
11 silly mapToRegistry registry https://registry.npmjs.org/
19+
12 silly mapToRegistry data Result {
20+
12 silly mapToRegistry raw: 'npm',
21+
12 silly mapToRegistry scope: null,
22+
12 silly mapToRegistry escapedName: 'npm',
23+
12 silly mapToRegistry name: 'npm',
24+
12 silly mapToRegistry rawSpec: '',
25+
12 silly mapToRegistry spec: 'latest',
26+
12 silly mapToRegistry type: 'tag'
27+
12 silly mapToRegistry }
28+
13 silly mapToRegistry uri https://registry.npmjs.org/npm
29+
14 verbose request uri https://registry.npmjs.org/npm
30+
15 verbose request no auth needed
31+
16 info attempt registry request try #1 at 1:37:10 pm
32+
17 verbose request id c512d41192cd9281
33+
18 verbose etag W/"a6c4f93c9e0859636f1f60cc3246d225"
34+
19 verbose lastModified Wed, 25 Jun 2025 20:11:21 GMT
35+
20 http request GET https://registry.npmjs.org/npm
36+
21 http 304 https://registry.npmjs.org/npm
37+
22 verbose headers {
38+
22 verbose headers date: 'Sun, 20 Jul 2025 08:07:09 GMT',
39+
22 verbose headers connection: 'keep-alive',
40+
22 verbose headers 'cf-ray': '9620f69b9b88cc07-BOM',
41+
22 verbose headers 'cf-cache-status': 'HIT',
42+
22 verbose headers 'access-control-allow-origin': '*',
43+
22 verbose headers age: '83',
44+
22 verbose headers 'cache-control': 'public, max-age=300',
45+
22 verbose headers etag: '"a6c4f93c9e0859636f1f60cc3246d225"',
46+
22 verbose headers 'last-modified': 'Wed, 25 Jun 2025 20:11:21 GMT',
47+
22 verbose headers vary: 'Accept-Encoding',
48+
22 verbose headers 'set-cookie': [
49+
22 verbose headers '_cfuvid=iWWrIi.xpOElCpVzSMUHw2AFLxwuno1mQ63wOQT1AgM-1752998829424-0.0.1.1-604800000; path=/; domain=.npmjs.org; HttpOnly; Secure; SameSite=None'
50+
22 verbose headers ],
51+
22 verbose headers server: 'cloudflare'
52+
22 verbose headers }
53+
23 silly get cb [
54+
23 silly get 304,
55+
23 silly get {
56+
23 silly get date: 'Sun, 20 Jul 2025 08:07:09 GMT',
57+
23 silly get connection: 'keep-alive',
58+
23 silly get 'cf-ray': '9620f69b9b88cc07-BOM',
59+
23 silly get 'cf-cache-status': 'HIT',
60+
23 silly get 'access-control-allow-origin': '*',
61+
23 silly get age: '83',
62+
23 silly get 'cache-control': 'public, max-age=300',
63+
23 silly get etag: '"a6c4f93c9e0859636f1f60cc3246d225"',
64+
23 silly get 'last-modified': 'Wed, 25 Jun 2025 20:11:21 GMT',
65+
23 silly get vary: 'Accept-Encoding',
66+
23 silly get 'set-cookie': [
67+
23 silly get '_cfuvid=iWWrIi.xpOElCpVzSMUHw2AFLxwuno1mQ63wOQT1AgM-1752998829424-0.0.1.1-604800000; path=/; domain=.npmjs.org; HttpOnly; Secure; SameSite=None'
68+
23 silly get ],
69+
23 silly get server: 'cloudflare'
70+
23 silly get }
71+
23 silly get ]
72+
24 verbose etag https://registry.npmjs.org/npm from cache
73+
25 verbose get saving npm to C:\Users\avado\AppData\Roaming\npm-cache\registry.npmjs.org\npm\.cache.json
74+
26 verbose correctMkdir C:\Users\avado\AppData\Roaming\npm-cache correctMkdir not in flight; initializing
75+
27 verbose stack TypeError: cb.apply is not a function
76+
27 verbose stack at C:\Users\avado\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:267:18
77+
27 verbose stack at FSReqCallback.oncomplete (node:fs:191:5)
78+
28 verbose cwd D:\PROJECTS\CONTRIBUTIONS\VALIDATOR JS\validator.js
79+
29 error Windows_NT 10.0.26100
80+
30 error argv "C:\\nvm4w\\nodejs\\node.exe" "C:\\Users\\avado\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "npm"
81+
31 error node v24.4.1
82+
32 error npm v3.10.10
83+
33 error cb.apply is not a function
84+
34 error If you need help, you may report this error at:
85+
34 error <https://github.com/npm/npm/issues>
86+
35 verbose exit [ 1, true ]

src/lib/alpha.js

Lines changed: 48 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,99 @@
11
export const alpha = {
2-
'en-US': /^[A-Z]+$/i,
2+
ar: /^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,
33
'az-AZ': /^[A-VXYZÇƏĞİıÖŞÜ]+$/i,
44
'bg-BG': /^[А-Я]+$/i,
5+
bn: /^['ি']+$/,
56
'cs-CZ': /^[A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,
67
'da-DK': /^[A-ZÆØÅ]+$/i,
78
'de-DE': /^[A-ZÄÖÜß]+$/i,
89
'el-GR': /^[Α-ώ]+$/i,
10+
eo: /^[ABCĈD-GĜHĤIJĴK-PRSŜTUŬVZ]+$/i,
911
'es-ES': /^[A-ZÁÉÍÑÓÚÜ]+$/i,
12+
'en-US': /^[A-Z]+$/i,
13+
fa: /^['آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی']+$/i,
1014
'fa-IR': /^[ابپتثجچحخدذرزژسشصضطظعغفقکگلمنوهی]+$/i,
1115
'fi-FI': /^[A-ZÅÄÖ]+$/i,
1216
'fr-FR': /^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,
17+
'gu-IN': /^[\u0A80-\u0AFF]+$/i,
18+
he: /^[א-ת]+$/,
19+
'hi-IN': /^[\u0900-\u0961]+[\u0972-\u097F]*$/i,
20+
'hu-HU': /^[A-ZÁÉÍÓÖŐÚÜŰ]+$/i,
1321
'it-IT': /^[A-ZÀÉÈÌÎÓÒÙ]+$/i,
1422
'ja-JP': /^[----]+$/i,
23+
'kk-KZ': /^[А-ЯЁ\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i,
24+
'kn-IN': /^[\u0C80-\u0CFF]+$/i,
25+
'ku-IQ': /^[ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,
26+
'ml-IN': /^[\u0D00-\u0D7F]+$/i,
1527
'nb-NO': /^[A-ZÆØÅ]+$/i,
1628
'nl-NL': /^[A-ZÁÉËÏÓÖÜÚ]+$/i,
1729
'nn-NO': /^[A-ZÆØÅ]+$/i,
18-
'hu-HU': /^[A-ZÁÉÍÓÖŐÚÜŰ]+$/i,
30+
'or-IN': /^[\u0B00-\u0B7F]+$/i,
31+
'pa-IN': /^[\u0A00-\u0A7F]+$/i,
1932
'pl-PL': /^[A-ZĄĆĘŚŁŃÓŻŹ]+$/i,
2033
'pt-PT': /^[A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,
2134
'ru-RU': /^[А-ЯЁ]+$/i,
22-
'kk-KZ': /^[А-ЯЁ\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i,
23-
'sl-SI': /^[A-ZČĆĐŠŽ]+$/i,
35+
'si-LK': /^[\u0D80-\u0DFF]+$/,
2436
'sk-SK': /^[A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,
25-
'sr-RS@latin': /^[A-ZČĆŽŠĐ]+$/i,
37+
'sl-SI': /^[A-ZČĆĐŠŽ]+$/i,
2638
'sr-RS': /^[А-ЯЂЈЉЊЋЏ]+$/i,
39+
'sr-RS@latin': /^[A-ZČĆŽŠĐ]+$/i,
2740
'sv-SE': /^[A-ZÅÄÖ]+$/i,
41+
'ta-IN': /^[\u0B80-\u0BFF]+$/i,
42+
'te-IN': /^[\u0C00-\u0C7F]+$/i,
2843
'th-TH': /^[-\s]+$/i,
2944
'tr-TR': /^[A-ZÇĞİıÖŞÜ]+$/i,
3045
'uk-UA': /^[А-ЩЬЮЯЄIЇҐі]+$/i,
3146
'vi-VN': /^[A-ZÀÁÃÂĂĐÈÉÊÌÍĨÒÓÕÔƠÙÚŨƯÝ]+$/i,
3247
'ko-KR': /^[---]*$/,
33-
'ku-IQ': /^[ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,
34-
ar: /^[ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,
35-
he: /^[א-ת]+$/,
36-
fa: /^['آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی']+$/i,
37-
bn: /^['ি']+$/,
38-
eo: /^[ABCĈD-GĜHĤIJĴK-PRSŜTUŬVZ]+$/i,
39-
'hi-IN': /^[\u0900-\u0961]+[\u0972-\u097F]*$/i,
40-
'si-LK': /^[\u0D80-\u0DFF]+$/,
41-
'ta-IN': /^[\u0B80-\u0BFF]+$/i,
42-
'te-IN': /^[\u0C00-\u0C7F]+$/i,
43-
'kn-IN': /^[\u0C80-\u0CFF]+$/i,
44-
'ml-IN': /^[\u0D00-\u0D7F]+$/i,
45-
'gu-IN': /^[\u0A80-\u0AFF]+$/i,
46-
'pa-IN': /^[\u0A00-\u0A7F]+$/i,
47-
'or-IN': /^[\u0B00-\u0B7F]+$/i,
4848
};
49-
5049
export const alphanumeric = {
51-
'en-US': /^[0-9A-Z]+$/i,
50+
ar: /^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,
5251
'az-AZ': /^[0-9A-VXYZÇƏĞİıÖŞÜ]+$/i,
5352
'bg-BG': /^[0-9А-Я]+$/i,
53+
bn: /^['ি']+$/,
54+
'bn-IN': /^[\u0980-\u09FF0-9]+$/i,
5455
'cs-CZ': /^[0-9A-ZÁČĎÉĚÍŇÓŘŠŤÚŮÝŽ]+$/i,
5556
'da-DK': /^[0-9A-ZÆØÅ]+$/i,
5657
'de-DE': /^[0-9A-ZÄÖÜß]+$/i,
5758
'el-GR': /^[0-9Α-ω]+$/i,
59+
'en-US': /^[0-9A-Z]+$/i,
60+
eo: /^[0-9ABCĈD-GĜHĤIJĴK-PRSŜTUŬVZ]+$/i,
5861
'es-ES': /^[0-9A-ZÁÉÍÑÓÚÜ]+$/i,
62+
fa: /^['0-9آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی۱۲۳۴۵۶۷۸۹۰']+$/i,
5963
'fi-FI': /^[0-9A-ZÅÄÖ]+$/i,
6064
'fr-FR': /^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,
65+
'gu-IN': /^[0-9\u0A80-\u0AFF]+$/i,
66+
he: /^[0-9א-ת]+$/,
67+
'hi-IN': /^[\u0900-\u0963]+[\u0966-\u097F]*$/i,
68+
'hu-HU': /^[0-9A-ZÁÉÍÓÖŐÚÜŰ]+$/i,
69+
'id-ID': undefined, // Add regex if needed
6170
'it-IT': /^[0-9A-ZÀÉÈÌÎÓÒÙ]+$/i,
6271
'ja-JP': /^[0-9-----]+$/i,
63-
'hu-HU': /^[0-9A-ZÁÉÍÓÖŐÚÜŰ]+$/i,
72+
'kk-KZ': /^[0-9А-ЯЁ\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i,
73+
'kn-IN': /^[0-9\u0C80-\u0CFF]+$/i,
74+
'ko-KR': /^[0-9---]*$/,
75+
'ku-IQ': /^[٠١٢٣٤٥٦٧٨٩0-9ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,
76+
'ml-IN': /^[0-9\u0D00-\u0D7F]+$/i,
6477
'nb-NO': /^[0-9A-ZÆØÅ]+$/i,
6578
'nl-NL': /^[0-9A-ZÁÉËÏÓÖÜÚ]+$/i,
6679
'nn-NO': /^[0-9A-ZÆØÅ]+$/i,
80+
'or-IN': /^[0-9\u0B00-\u0B7F]+$/i,
81+
'pa-IN': /^[0-9\u0A00-\u0A7F]+$/i,
6782
'pl-PL': /^[0-9A-ZĄĆĘŚŁŃÓŻŹ]+$/i,
6883
'pt-PT': /^[0-9A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/i,
6984
'ru-RU': /^[0-9А-ЯЁ]+$/i,
70-
'kk-KZ': /^[0-9А-ЯЁ\u04D8\u04B0\u0406\u04A2\u0492\u04AE\u049A\u04E8\u04BA]+$/i,
71-
'sl-SI': /^[0-9A-ZČĆĐŠŽ]+$/i,
85+
'si-LK': /^[0-9\u0D80-\u0DFF]+$/,
7286
'sk-SK': /^[0-9A-ZÁČĎÉÍŇÓŠŤÚÝŽĹŔĽÄÔ]+$/i,
73-
'sr-RS@latin': /^[0-9A-ZČĆŽŠĐ]+$/i,
87+
'sl-SI': /^[0-9A-ZČĆĐŠŽ]+$/i,
7488
'sr-RS': /^[0-9А-ЯЂЈЉЊЋЏ]+$/i,
89+
'sr-RS@latin': /^[0-9A-ZČĆŽŠĐ]+$/i,
7590
'sv-SE': /^[0-9A-ZÅÄÖ]+$/i,
91+
'ta-IN': /^[0-9\u0B80-\u0BFF]+$/i,
92+
'te-IN': /^[0-9\u0C00-\u0C7F]+$/i,
7693
'th-TH': /^[-\s]+$/i,
7794
'tr-TR': /^[0-9A-ZÇĞİıÖŞÜ]+$/i,
7895
'uk-UA': /^[0-9А-ЩЬЮЯЄIЇҐі]+$/i,
79-
'ko-KR': /^[0-9---]*$/,
80-
'ku-IQ': /^[٠١٢٣٤٥٦٧٨٩0-9ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i,
8196
'vi-VN': /^[0-9A-ZÀÁÃÂĂĐÈÉÊÌÍĨÒÓÕÔƠÙÚŨƯÝ]+$/i,
82-
ar: /^[٠١٢٣٤٥٦٧٨٩0-9ءآأؤإئابةتثجحخدذرزسشصضطظعغفقكلمنهوىيًٌٍَُِّْٰ]+$/,
83-
he: /^[0-9א-ת]+$/,
84-
fa: /^['0-9آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی۱۲۳۴۵۶۷۸۹۰']+$/i,
85-
bn: /^['ি']+$/,
86-
eo: /^[0-9ABCĈD-GĜHĤIJĴK-PRSŜTUŬVZ]+$/i,
87-
'hi-IN': /^[\u0900-\u0963]+[\u0966-\u097F]*$/i,
88-
'si-LK': /^[0-9\u0D80-\u0DFF]+$/,
89-
'ta-IN': /^[0-9\u0B80-\u0BFF]+$/i,
90-
'te-IN': /^[0-9\u0C00-\u0C7F]+$/i,
91-
'kn-IN': /^[0-9\u0C80-\u0CFF]+$/i,
92-
'ml-IN': /^[0-9\u0D00-\u0D7F]+$/i,
93-
'gu-IN': /^[0-9\u0A80-\u0AFF]+$/i,
94-
'pa-IN': /^[0-9\u0A00-\u0A7F]+$/i,
95-
'or-IN': /^[0-9\u0B00-\u0B7F]+$/i,
9697
};
9798

9899
export const decimal = {
@@ -129,13 +130,6 @@ for (let locale, i = 0; i < farsiLocales.length; i++) {
129130
decimal[locale] = decimal.ar;
130131
}
131132

132-
export const indicLocales = ['ta-IN', 'te-IN', 'kn-IN', 'ml-IN', 'gu-IN', 'pa-IN', 'or-IN'];
133-
134-
for (let i = 0; i < indicLocales.length; i++) {
135-
const locale = indicLocales[i];
136-
decimal[locale] = '.';
137-
}
138-
139133
export const bengaliLocales = ['BD', 'IN'];
140134

141135
for (let locale, i = 0; i < bengaliLocales.length; i++) {
@@ -147,13 +141,15 @@ for (let locale, i = 0; i < bengaliLocales.length; i++) {
147141

148142
// Source: https://en.wikipedia.org/wiki/Decimal_mark
149143
export const dotDecimal = ['ar-EG', 'ar-LB', 'ar-LY'];
144+
// sorted
150145
export const commaDecimal = [
151146
'bg-BG', 'cs-CZ', 'da-DK', 'de-DE', 'el-GR', 'en-ZM', 'eo', 'es-ES', 'fr-CA', 'fr-FR',
152-
'id-ID', 'it-IT', 'ku-IQ', 'hi-IN', 'hu-HU', 'nb-NO', 'nn-NO', 'nl-NL', 'pl-PL', 'pt-PT',
153-
'ru-RU', 'kk-KZ', 'si-LK', 'sl-SI', 'sr-RS@latin', 'sr-RS', 'sv-SE', 'tr-TR', 'uk-UA', 'vi-VN',
154-
'ta-IN', 'te-IN', 'kn-IN', 'ml-IN', 'gu-IN', 'pa-IN', 'or-IN',
147+
'gu-IN', 'hi-IN', 'hu-HU', 'id-ID', 'it-IT', 'kk-KZ', 'kn-IN', 'ku-IQ', 'ml-IN', 'nb-NO',
148+
'nl-NL', 'nn-NO', 'or-IN', 'pa-IN', 'pl-PL', 'pt-PT', 'ru-RU', 'si-LK', 'sl-SI', 'sr-RS',
149+
'sr-RS@latin', 'sv-SE', 'ta-IN', 'te-IN', 'tr-TR', 'uk-UA', 'vi-VN',
155150
];
156151

152+
157153
for (let i = 0; i < dotDecimal.length; i++) {
158154
decimal[dotDecimal[i]] = decimal['en-US'];
159155
}

0 commit comments

Comments
 (0)