Skip to content

Commit

Permalink
Merge pull request #738 from PuHsiu/master
Browse files Browse the repository at this point in the history
Update the jp mobile phone validator
  • Loading branch information
chriso authored Oct 25, 2017
2 parents 8c9ffb0 + fd80b15 commit 92015c5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/lib/isMobilePhone.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const phones = {
'hu-HU': /^(\+?36)(20|30|70)\d{7}$/,
'id-ID': /^(\+?62|0[1-9])[\s|\d]+$/,
'it-IT': /^(\+?39)?\s?3\d{2} ?\d{6,7}$/,
'ja-JP': /^(\+?81|0)\d{1,4}[ \-]?\d{1,4}[ \-]?\d{4}$/,
'ja-JP': /^(\+?81|0)[789]0[ \-]?[1-9]\d{2}[ \-]?\d{5}$/,
'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}$/,
'lt-LT': /^(\+370|8)\d{8}$/,
Expand Down
25 changes: 13 additions & 12 deletions test/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -3573,19 +3573,9 @@ describe('Validators', function () {
{
locale: 'ja-JP',
valid: [
'0312345678',
'0721234567',
'09012345688',
'06 1234 5678',
'072 123 4567',
'0729 12 3456',
'07296 1 2345',
'072961 2345',
'090 1234 5678',
'03-1234-5678',
'+81312345678',
'+816-1234-5678',
'+8190-1234-5678',
'090 123 45678',
'+8190-123-45678',
],
invalid: [
'12345',
Expand All @@ -3596,6 +3586,17 @@ describe('Validators', function () {
'0 1234 5689',
'16 1234 5689',
'03_1234_5689',
'0312345678',
'0721234567',
'08002345678',
'06 1234 5678',
'072 123 4567',
'0729 12 3456',
'07296 1 2345',
'072961 2345',
'03-1234-5678',
'+81312345678',
'+816-1234-5678',
],
},
{
Expand Down

0 comments on commit 92015c5

Please sign in to comment.