AfterShip / phone

With a given country and phone number, validate and reformat the mobile phone number to the E.164 standard. The purpose of this is to allow us to send SMS to mobile phones only.
https://www.aftership.com
MIT License
851 stars 268 forks source link

New numbers in China. #96

Closed xream closed 5 years ago

xream commented 6 years ago

Ministry of Industry and Information Technology of China disclosed a number of new numbers in 2017 tenth "telecommunications network code resource use certificate"

China Telecom: 199 China Mobile: 198 China Unicom: 166

HiuKwok commented 6 years ago

Hi there @xream, From what I understand the current logic for validating mobile number for China is kind of loosen. It only check for the first two digit. https://github.com/AfterShip/phone/blob/0546c98636c0740e80b3b04a4e4a74698c0fc472/lib/iso3166Data.js#L350-L355

Hence it should work just fine. For those numbers which are 199, 198, 166 respectively. But anyway extra test case is needed against those new pattern would be great to avoid confusion I think.

Bossa573 commented 5 years ago

PR is merged for the extra test cases, please reopen this issue if needed, thanks for the contribution