This commit is contained in:
陆柯 2023-02-15 19:22:17 +08:00
parent 871fa975b0
commit 8eba84d1b9

View File

@ -7,17 +7,17 @@ module.exports = {
let [fullphone, itc, callnumber] = /^\+(\d{1,3})-(\d{7,11})$/.exec(phone) let [fullphone, itc, callnumber] = /^\+(\d{1,3})-(\d{7,11})$/.exec(phone)
switch (itc) { switch (itc) {
case this.CN.itc: case this.CN.itc:
return this.CN.reCallnumber.test(callnumber) return new RegExp(this.CN.reCallnumber).test(callnumber)
case this.SG.itc: case this.SG.itc:
return this.SG.reCallnumber.test(callnumber) return new RegExp(this.CN.reCallnumber).test(callnumber)
case this.US.itc: case this.US.itc:
return this.US.reCallnumber.test(callnumber) return new RegExp(this.CN.reCallnumber).test(callnumber)
case this.JP.itc: case this.JP.itc:
return this.JP.reCallnumber.test(callnumber) return new RegExp(this.CN.reCallnumber).test(callnumber)
default: default:
return true return true
} }
} catch (err) { } catch (error) {
return false return false
} }
}, },
@ -788,7 +788,7 @@ module.exports = {
namefull: { enUS: "the People's Republic of China", zhCN: '中华人民共和国' }, namefull: { enUS: "the People's Republic of China", zhCN: '中华人民共和国' },
notes: notes:
'“GB/T 2659-2000”的“CN”适用于整个中华人民共和国辖区包括中国大陆、香港、澳门。而“ISO 3166-1”和“CNS 12842”的“CN”则仅适用于中国大陆不含港澳地区。', '“GB/T 2659-2000”的“CN”适用于整个中华人民共和国辖区包括中国大陆、香港、澳门。而“ISO 3166-1”和“CNS 12842”的“CN”则仅适用于中国大陆不含港澳地区。',
reCallnumber: {}, reCallnumber: /^1\d{10}$/.source,
timezone: '0', timezone: '0',
}, },
CO: { CO: {
@ -1850,7 +1850,7 @@ module.exports = {
name: { enUS: 'Japan', native: '日本', zhCN: '日本', zhHK: '日本', zhTW: '日本' }, name: { enUS: 'Japan', native: '日本', zhCN: '日本', zhHK: '日本', zhTW: '日本' },
namefull: { enUS: '', zhCN: '日本国' }, namefull: { enUS: '', zhCN: '日本国' },
notes: '', notes: '',
reCallnumber: {}, reCallnumber: /^\d{10}$/.source,
timezone: '1', timezone: '1',
}, },
KE: { KE: {
@ -3201,7 +3201,7 @@ module.exports = {
name: { enUS: 'Singapore', zhCN: '新加坡', zhHK: '新加坡', zhTW: '新加坡' }, name: { enUS: 'Singapore', zhCN: '新加坡', zhHK: '新加坡', zhTW: '新加坡' },
namefull: { enUS: 'the Republic of Singapore', zhCN: '新加坡共和国' }, namefull: { enUS: 'the Republic of Singapore', zhCN: '新加坡共和国' },
notes: '', notes: '',
reCallnumber: {}, reCallnumber: /^[89]\d{7}$/.source,
timezone: '0', timezone: '0',
}, },
SH: { SH: {
@ -3763,7 +3763,7 @@ module.exports = {
name: { enUS: 'United States', zhCN: '美国', zhHK: '美国', zhTW: '美国' }, name: { enUS: 'United States', zhCN: '美国', zhHK: '美国', zhTW: '美国' },
namefull: { enUS: 'the United States of America', zhCN: '美利坚合众国' }, namefull: { enUS: 'the United States of America', zhCN: '美利坚合众国' },
notes: '', notes: '',
reCallnumber: {}, reCallnumber: /^\d{10}$/.source,
timezone: '-13', timezone: '-13',
}, },
UY: { UY: {