Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid number error for Singapore number starting with +6589xxxxxx and +6580xxxxxx #30

Open
kingcashthefifth opened this issue Jun 4, 2020 · 0 comments

Comments

@kingcashthefifth
Copy link

Hi @mattbornski ,
I have encountered an invalid number error while trying to do the following:

var libphonenumber = require('libphonenumber');

const testNum1 = '+6581002500';
const testNum2 = '+6582002500';
const testNum3 = '+6589002500';
const testNum4 = '+6580002500';

console.log('libphonenumber, testNum1: ', libphonenumber.validate(testNum1));
console.log('libphonenumber, testNum2: ', libphonenumber.validate(testNum2));
console.log('libphonenumber, testNum3 ', libphonenumber.validate(testNum3));
console.log('libphonenumber, testNum4: ', libphonenumber.validate(testNum4));

While using variables testNum3 and testNum4 to test, there was an error as follow:

Error: Invalid number
    at validateNumber (/home/runner/DenseDirectMiddleware/node_modules/libphonenumber/lib/index.js:53:21)
    at Object.validate (/home/runner/DenseDirectMiddleware/node_modules/libphonenumber/lib/index.js:99:23)
    at /home/runner/DenseDirectMiddleware/index.js:31:58
    at Script.runInContext (vm.js:131:20)
    at Object.<anonymous> (/run_dir/interp.js:156:20)
    at Module._compile (internal/modules/cjs/loader.js:1133:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
    at Module.load (internal/modules/cjs/loader.js:977:32)
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)

+6589xxxxxx and +6580xxxxxx are both valid singapore number formats.
Are you able to provide a fix for this?

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant