Skip to content

Commit 92015c5

Browse files
authored
Merge pull request #738 from PuHsiu/master
Update the jp mobile phone validator
2 parents 8c9ffb0 + fd80b15 commit 92015c5

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

src/lib/isMobilePhone.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const phones = {
3636
'hu-HU': /^(\+?36)(20|30|70)\d{7}$/,
3737
'id-ID': /^(\+?62|0[1-9])[\s|\d]+$/,
3838
'it-IT': /^(\+?39)?\s?3\d{2} ?\d{6,7}$/,
39-
'ja-JP': /^(\+?81|0)\d{1,4}[ \-]?\d{1,4}[ \-]?\d{4}$/,
39+
'ja-JP': /^(\+?81|0)[789]0[ \-]?[1-9]\d{2}[ \-]?\d{5}$/,
4040
'kl-GL': /^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/,
4141
'ko-KR': /^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/,
4242
'lt-LT': /^(\+370|8)\d{8}$/,

test/validators.js

+13-12
Original file line numberDiff line numberDiff line change
@@ -3573,19 +3573,9 @@ describe('Validators', function () {
35733573
{
35743574
locale: 'ja-JP',
35753575
valid: [
3576-
'0312345678',
3577-
'0721234567',
35783576
'09012345688',
3579-
'06 1234 5678',
3580-
'072 123 4567',
3581-
'0729 12 3456',
3582-
'07296 1 2345',
3583-
'072961 2345',
3584-
'090 1234 5678',
3585-
'03-1234-5678',
3586-
'+81312345678',
3587-
'+816-1234-5678',
3588-
'+8190-1234-5678',
3577+
'090 123 45678',
3578+
'+8190-123-45678',
35893579
],
35903580
invalid: [
35913581
'12345',
@@ -3596,6 +3586,17 @@ describe('Validators', function () {
35963586
'0 1234 5689',
35973587
'16 1234 5689',
35983588
'03_1234_5689',
3589+
'0312345678',
3590+
'0721234567',
3591+
'08002345678',
3592+
'06 1234 5678',
3593+
'072 123 4567',
3594+
'0729 12 3456',
3595+
'07296 1 2345',
3596+
'072961 2345',
3597+
'03-1234-5678',
3598+
'+81312345678',
3599+
'+816-1234-5678',
35993600
],
36003601
},
36013602
{

0 commit comments

Comments
 (0)