move landSet.validatePhone to i18tool.validate_phone

This commit is contained in:
Luk Lu
2023-02-15 19:51:41 +08:00
parent 8eba84d1b9
commit 127674b32d
3 changed files with 24 additions and 19 deletions

View File

@@ -2,25 +2,6 @@
// https://www.iso.org/obp/ui/#search
module.exports = {
validatePhone ({ phone } = {}) {
try {
let [fullphone, itc, callnumber] = /^\+(\d{1,3})-(\d{7,11})$/.exec(phone)
switch (itc) {
case this.CN.itc:
return new RegExp(this.CN.reCallnumber).test(callnumber)
case this.SG.itc:
return new RegExp(this.CN.reCallnumber).test(callnumber)
case this.US.itc:
return new RegExp(this.CN.reCallnumber).test(callnumber)
case this.JP.itc:
return new RegExp(this.CN.reCallnumber).test(callnumber)
default:
return true
}
} catch (error) {
return false
}
},
AD: {
domain: 'ad',
emoji: '🇦🇩',