Giter VIP home page Giter VIP logo

Comments (4)

Bossa573 avatar Bossa573 commented on September 27, 2024

if you know the phone number is a Chinese phone number,
please append +86 before the phone number, or specify "CHN" in options.country.

The library does not have the capability to determine if you only provide an 11-digit string because it can potentially match many countries' formats,
and therefore if there is no country code provided,
the library will simply assume the phone number is a USA phone number.

See https://github.com/AfterShip/phone#3-without-country-code-and-no-phone-prefix for detail.

from phone.

wt-fangying avatar wt-fangying commented on September 27, 2024

In my problem, a Chinese phone number like 17862571736 is recognized as a US number when testing +1 17862571736, the verification should recognize the 1 of the number as a US +1, but +86 17862571747 is recognized as a Chinese number. I hope the result is that +1 17862571736 should not pass.

from phone.

Bossa573 avatar Bossa573 commented on September 27, 2024

+117862571736 works because of truck code detection logic, please check https://github.com/AfterShip/phone#6-trunk-code-detection-logic
You can see from the result, it became +17862571736 automatically

from phone.

wt-fangying avatar wt-fangying commented on September 27, 2024

Thank you very much, the problem has been solved. I apologize for disturbing you due to my oversight of not checking the documentation carefully.

from phone.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.