Skip to content

Commit e12a2c5

Browse files
author
Ashutosh Kumar
committed
fix(isMobilePhone): update fr-CH and it-CH locale aliases (#1549)
1 parent c3445a8 commit e12a2c5

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/lib/isMobilePhone.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ const phones = {
7373
'fi-FI': /^(\+?358|0)\s?(4(0|1|2|4|5|6)?|50)\s?(\d\s?){4,8}\d$/,
7474
'fj-FJ': /^(\+?679)?\s?\d{3}\s?\d{4}$/,
7575
'fo-FO': /^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/,
76-
'fr-CH': /^(\+41|0)([1-9])\d{1,9}$/,
7776
'fr-FR': /^(\+?33|0)[67]\d{8}$/,
7877
'fr-GF': /^(\+?594|0|00594)[67]\d{8}$/,
7978
'fr-GP': /^(\+?590|0|00590)[67]\d{8}$/,
@@ -82,7 +81,6 @@ const phones = {
8281
'he-IL': /^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}$/,
8382
'hu-HU': /^(\+?36)(20|30|70)\d{7}$/,
8483
'id-ID': /^(\+?62|0)8(1[123456789]|2[1238]|3[1238]|5[12356789]|7[78]|9[56789]|8[123456789])([\s?|\d]{5,11})$/,
85-
'it-CH': /^(\+41|0)([1-9])\d{1,9}$/,
8684
'it-IT': /^(\+?39)?\s?3\d{2} ?\d{6,7}$/,
8785
'it-SM': /^((\+378)|(0549)|(\+390549)|(\+3780549))?6\d{5,9}$/,
8886
'ja-JP': /^(\+81[ \-]?(\(0\))?|0)[6789]0[ \-]?\d{4}[ \-]?\d{4}$/,
@@ -125,6 +123,8 @@ phones['fr-BE'] = phones['nl-BE'];
125123
phones['zh-HK'] = phones['en-HK'];
126124
phones['zh-MO'] = phones['en-MO'];
127125
phones['ga-IE'] = phones['en-IE'];
126+
phones['fr-CH'] = phones['de-CH'];
127+
phones['it-CH'] = phones['fr-CH'];
128128

129129
export default function isMobilePhone(str, locale, options) {
130130
assertString(str);

validator.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3828,7 +3828,6 @@ var phones = {
38283828
'fi-FI': /^(\+?358|0)\s?(4(0|1|2|4|5|6)?|50)\s?(\d\s?){4,8}\d$/,
38293829
'fj-FJ': /^(\+?679)?\s?\d{3}\s?\d{4}$/,
38303830
'fo-FO': /^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/,
3831-
'fr-CH': /^(\+41|0)([1-9])\d{1,9}$/,
38323831
'fr-FR': /^(\+?33|0)[67]\d{8}$/,
38333832
'fr-GF': /^(\+?594|0|00594)[67]\d{8}$/,
38343833
'fr-GP': /^(\+?590|0|00590)[67]\d{8}$/,
@@ -3837,7 +3836,6 @@ var phones = {
38373836
'he-IL': /^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}$/,
38383837
'hu-HU': /^(\+?36)(20|30|70)\d{7}$/,
38393838
'id-ID': /^(\+?62|0)8(1[123456789]|2[1238]|3[1238]|5[12356789]|7[78]|9[56789]|8[123456789])([\s?|\d]{5,11})$/,
3840-
'it-CH': /^(\+41|0)([1-9])\d{1,9}$/,
38413839
'it-IT': /^(\+?39)?\s?3\d{2} ?\d{6,7}$/,
38423840
'it-SM': /^((\+378)|(0549)|(\+390549)|(\+3780549))?6\d{5,9}$/,
38433841
'ja-JP': /^(\+81[ \-]?(\(0\))?|0)[6789]0[ \-]?\d{4}[ \-]?\d{4}$/,
@@ -3879,6 +3877,8 @@ phones['fr-BE'] = phones['nl-BE'];
38793877
phones['zh-HK'] = phones['en-HK'];
38803878
phones['zh-MO'] = phones['en-MO'];
38813879
phones['ga-IE'] = phones['en-IE'];
3880+
phones['fr-CH'] = phones['de-CH'];
3881+
phones['it-CH'] = phones['fr-CH'];
38823882
function isMobilePhone(str, locale, options) {
38833883
assertString(str);
38843884

validator.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)