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

(isMobilePhone) update new number format for vi-VN locale #904

Merged
merged 1 commit into from
Oct 11, 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 lib/isMobilePhone.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ var phones = {
'th-TH': /^(\+66|66|0)\d{9}$/,
'tr-TR': /^(\+?90|0)?5\d{9}$/,
'uk-UA': /^(\+?38|8)?0\d{9}$/,
'vi-VN': /^(\+?84|0)?((1(2([0-9])|6([2-9])|88|99))|(9((?!5)[0-9])))([0-9]{7})$/,
'vi-VN': /^(\+?84|0)((3([2-9]))|(5([689]))|(7([0|6-9]))|(8([1-5]))|(9([0-9])))([0-9]{7})$/,
'zh-CN': /^((\+|00)86)?1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}$/,
'zh-TW': /^(\+?886\-?|0)?9\d{8}$/
};
Expand Down
2 changes: 1 addition & 1 deletion src/lib/isMobilePhone.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const phones = {
'th-TH': /^(\+66|66|0)\d{9}$/,
'tr-TR': /^(\+?90|0)?5\d{9}$/,
'uk-UA': /^(\+?38|8)?0\d{9}$/,
'vi-VN': /^(\+?84|0)?((1(2([0-9])|6([2-9])|88|99))|(9((?!5)[0-9])))([0-9]{7})$/,
'vi-VN': /^(\+?84|0)((3([2-9]))|(5([689]))|(7([0|6-9]))|(8([1-5]))|(9([0-9])))([0-9]{7})$/,
'zh-CN': /^((\+|00)86)?1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}$/,
'zh-TW': /^(\+?886\-?|0)?9\d{8}$/,
};
Expand Down
16 changes: 8 additions & 8 deletions test/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -3966,21 +3966,21 @@ describe('Validators', () => {
{
locale: 'vi-VN',
valid: [
'01636012403',
'+841636012403',
'1636012403',
'841636012403',
'+84999999999',
'84999999999',
'0999999999',
'999999999',
'0336012403',
'+84586012403',
'84981577798',
'0708001240',
'84813601243',
],
invalid: [
'12345',
'',
'Vml2YW11cyBmZXJtZtesting123',
'010-38238383',
'260976684590',
'01678912345',
'+841698765432',
'841626543219',
],
},
{
Expand Down
2 changes: 1 addition & 1 deletion validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@ var phones = {
'th-TH': /^(\+66|66|0)\d{9}$/,
'tr-TR': /^(\+?90|0)?5\d{9}$/,
'uk-UA': /^(\+?38|8)?0\d{9}$/,
'vi-VN': /^(\+?84|0)?((1(2([0-9])|6([2-9])|88|99))|(9((?!5)[0-9])))([0-9]{7})$/,
'vi-VN': /^(\+?84|0)((3([2-9]))|(5([689]))|(7([0|6-9]))|(8([1-5]))|(9([0-9])))([0-9]{7})$/,
'zh-CN': /^((\+|00)86)?1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}$/,
'zh-TW': /^(\+?886\-?|0)?9\d{8}$/
};
Expand Down
2 changes: 1 addition & 1 deletion validator.min.js

Large diffs are not rendered by default.