Skip to content

Commit d557d44

Browse files
bigwisuchriso
authored andcommittedOct 23, 2018
fix(isMobilePhone): Indonesian locale update (#916)
1 parent 8445383 commit d557d44

File tree

2 files changed

+51
-10
lines changed

2 files changed

+51
-10
lines changed
 

‎src/lib/isMobilePhone.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const phones = {
4343
'fr-FR': /^(\+?33|0)[67]\d{8}$/,
4444
'he-IL': /^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}$/,
4545
'hu-HU': /^(\+?36)(20|30|70)\d{7}$/,
46-
'id-ID': /^(\+?62|0)(0?8?\d\d\s?\d?)([\s?|\d]{7,12})$/,
46+
'id-ID': /^(\+?62|0)8(1[123456789]|2[1238]|3[1238]|5[12356789]|7[78]|9[56789]|8[123456789])([\s?|\d]{5,11})$/,
4747
'it-IT': /^(\+?39)?\s?3\d{2} ?\d{6,7}$/,
4848
'ja-JP': /^(\+?81|0)[789]0[ \-]?[1-9]\d{2}[ \-]?\d{5}$/,
4949
'kk-KZ': /^(\+?7|8)?7\d{9}$/,

‎test/validators.js

+50-9
Original file line numberDiff line numberDiff line change
@@ -4335,20 +4335,53 @@ describe('Validators', () => {
43354335
{
43364336
locale: 'id-ID',
43374337
valid: [
4338-
'0217123456',
43394338
'0811 778 998',
4339+
'0811 7785 9983',
4340+
'0812 7784 9984',
4341+
'0813 7782 9982',
4342+
'0821 1234 1234',
4343+
'0822 1234 1234',
4344+
'0823 1234 1234',
4345+
'0852 1234 6764',
4346+
'0853 1234 6764',
4347+
'0851 1234 6764',
4348+
'0814 7782 9982',
4349+
'0815 7782 9982',
4350+
'0816 7782 9982',
4351+
'0855 7782 9982',
4352+
'0856 7782 9982',
4353+
'0857 7782 9982',
4354+
'0858 7782 9982',
4355+
'0817 7785 9983',
4356+
'0818 7784 9984',
4357+
'0819 7782 9982',
4358+
'0859 1234 1234',
4359+
'0877 1234 1234',
4360+
'0878 1234 1234',
4361+
'0895 7785 9983',
4362+
'0896 7784 9984',
4363+
'0897 7782 9982',
4364+
'0898 1234 1234',
4365+
'0899 1234 1234',
4366+
'0881 7785 9983',
4367+
'0882 7784 9984',
4368+
'0883 7782 9982',
4369+
'0884 1234 1234',
4370+
'0886 1234 1234',
4371+
'0887 1234 1234',
4372+
'0888 7785 9983',
4373+
'0889 7784 9984',
4374+
'0828 7784 9984',
4375+
'0838 7784 9984',
4376+
'0831 7784 9984',
4377+
'0832 7784 9984',
4378+
'0833 7784 9984',
43404379
'089931236181900',
4341-
'622178878890',
43424380
'62811 778 998',
43434381
'62811778998',
4344-
'6289931236181900',
4345-
'6221 740123456',
4346-
'62899 740123456',
4382+
'628993123618190',
4383+
'62898 740123456',
43474384
'62899 7401 2346',
4348-
'0341 8123456',
4349-
'0778 89800910',
4350-
'0741 123456',
4351-
'+6221740123456',
43524385
'+62811 778 998',
43534386
'+62811778998',
43544387
'+62812 9650 3508',
@@ -4357,6 +4390,14 @@ describe('Validators', () => {
43574390
'+62811787391',
43584391
],
43594392
invalid: [
4393+
'0899312361819001',
4394+
'0217123456',
4395+
'622178878890',
4396+
'6221 740123456',
4397+
'0341 8123456',
4398+
'0778 89800910',
4399+
'0741 123456',
4400+
'+6221740123456',
43604401
'+65740 123 456',
43614402
'',
43624403
'ASDFGJKLmZXJtZtesting123',

0 commit comments

Comments
 (0)
Please sign in to comment.