Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indonesian mobile operators 2018 #916

Merged
merged 1 commit into from
Oct 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/isMobilePhone.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const phones = {
'fr-FR': /^(\+?33|0)[67]\d{8}$/,
'he-IL': /^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}$/,
'hu-HU': /^(\+?36)(20|30|70)\d{7}$/,
'id-ID': /^(\+?62|0)(0?8?\d\d\s?\d?)([\s?|\d]{7,12})$/,
'id-ID': /^(\+?62|0)8(1[123456789]|2[1238]|3[1238]|5[12356789]|7[78]|9[56789]|8[123456789])([\s?|\d]{5,11})$/,
'it-IT': /^(\+?39)?\s?3\d{2} ?\d{6,7}$/,
'ja-JP': /^(\+?81|0)[789]0[ \-]?[1-9]\d{2}[ \-]?\d{5}$/,
'kk-KZ': /^(\+?7|8)?7\d{9}$/,
Expand Down
59 changes: 50 additions & 9 deletions test/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -4335,20 +4335,53 @@ describe('Validators', () => {
{
locale: 'id-ID',
valid: [
'0217123456',
'0811 778 998',
'0811 7785 9983',
'0812 7784 9984',
'0813 7782 9982',
'0821 1234 1234',
'0822 1234 1234',
'0823 1234 1234',
'0852 1234 6764',
'0853 1234 6764',
'0851 1234 6764',
'0814 7782 9982',
'0815 7782 9982',
'0816 7782 9982',
'0855 7782 9982',
'0856 7782 9982',
'0857 7782 9982',
'0858 7782 9982',
'0817 7785 9983',
'0818 7784 9984',
'0819 7782 9982',
'0859 1234 1234',
'0877 1234 1234',
'0878 1234 1234',
'0895 7785 9983',
'0896 7784 9984',
'0897 7782 9982',
'0898 1234 1234',
'0899 1234 1234',
'0881 7785 9983',
'0882 7784 9984',
'0883 7782 9982',
'0884 1234 1234',
'0886 1234 1234',
'0887 1234 1234',
'0888 7785 9983',
'0889 7784 9984',
'0828 7784 9984',
'0838 7784 9984',
'0831 7784 9984',
'0832 7784 9984',
'0833 7784 9984',
'089931236181900',
'622178878890',
'62811 778 998',
'62811778998',
'6289931236181900',
'6221 740123456',
'62899 740123456',
'628993123618190',
'62898 740123456',
'62899 7401 2346',
'0341 8123456',
'0778 89800910',
'0741 123456',
'+6221740123456',
'+62811 778 998',
'+62811778998',
'+62812 9650 3508',
Expand All @@ -4357,6 +4390,14 @@ describe('Validators', () => {
'+62811787391',
],
invalid: [
'0899312361819001',
'0217123456',
'622178878890',
'6221 740123456',
'0341 8123456',
'0778 89800910',
'0741 123456',
'+6221740123456',
'+65740 123 456',
'',
'ASDFGJKLmZXJtZtesting123',
Expand Down