Skip to content

Commit

Permalink
fix(isMobilePhone): ja_JP locale (#1073)
Browse files Browse the repository at this point in the history
This PR fixes ja_JP locale to support 060 prefix and also issue with the general sequence.

* fix Japanese mobile phone number

* add 060 for ja-JP of isMobile
  • Loading branch information
yomotsu authored and profnandaa committed Aug 2, 2019
1 parent 54bf8c4 commit 25e84cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/lib/isMobilePhone.js
Expand Up @@ -58,7 +58,7 @@ const phones = {
'hu-HU': /^(\+?36)(20|30|70)\d{7}$/,
'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}$/,
'ja-JP': /^(\+?81|0)[6789]0[ \-]?\d{4}[ \-]?\d{4}$/,
'kk-KZ': /^(\+?7|8)?7\d{9}$/,
'kl-GL': /^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/,
'ko-KR': /^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/,
Expand Down
10 changes: 6 additions & 4 deletions test/validators.js
Expand Up @@ -4779,9 +4779,12 @@ describe('Validators', () => {
{
locale: 'ja-JP',
valid: [
'09012345688',
'090 123 45678',
'+8190-123-45678',
'09012345678',
'08012345678',
'07012345678',
'06012345678',
'090 1234 5678',
'+8190-1234-5678',
],
invalid: [
'12345',
Expand All @@ -4794,7 +4797,6 @@ describe('Validators', () => {
'03_1234_5689',
'0312345678',
'0721234567',
'08002345678',
'06 1234 5678',
'072 123 4567',
'0729 12 3456',
Expand Down

0 comments on commit 25e84cf

Please sign in to comment.