Validator.js: isMobileNumber fail validating new MTN Zambian numbers

Created on 18 Dec 2019  路  7Comments  路  Source: validatorjs/validator.js

Hi there,

First, I wanted to thank you for providing this amazing library that makes a lot of developers life easier!

I built an express API that needs to validate international mobile numbers, including Zambian numbers. I am using the express-validator library which relies on validator.js under the hood.
To ensure the phone numbers received by this API are valid, I am using the following piece of code:

body('mobileNumber')
    .isMobilePhone('any', { strictMode: true })

It works fine, but it does not accept recent Zambia numbers which start with 076 (e.g. +260761234567)

Could you please help or let me know if this is on the roadmap?

Thanks a lot!

help wanted

Most helpful comment

@ezkemboi @profnandaa so this has been fixed by a pr? which has been merged... so this issue can be closed? I don't get the codebase acceptance criteria... I actually don't care anymore, was only looking for adding another/new validation but this would maybe later.

All 7 comments

Thanks Denis, I am experiencing the same issue.

Yes, after seeing the current implementation, valid mobile numbers for Zambia are those that start with 95 or 96 or 97.

@denisbarriere, I will check at the issue and will try to fix the same issue.
Also, if there are some resources that show all valid Zambia numbers prefix, you can share.

Thanks.

I can take this issue

@ezkemboi @profnandaa so this has been fixed by a pr? which has been merged... so this issue can be closed? I don't get the codebase acceptance criteria... I actually don't care anymore, was only looking for adding another/new validation but this would maybe later.

Sure.

thanks @meshack-mbuvi

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zilahir picture zilahir  路  3Comments

RPDeshaies picture RPDeshaies  路  4Comments

woverton picture woverton  路  4Comments

rathboma picture rathboma  路  4Comments

MindRapist picture MindRapist  路  4Comments