79325309

Date: 2025-01-03 01:47:52
Score: 1.5
Natty:
Report link

I found I had to do:

import { default as libphonenumber } from "google-libphonenumber";

const phoneUtil = libphonenumber.PhoneNumberUtil.getInstance();
const number = phoneUtil.parse(input, countryCode);
const numberE164 = phoneUtil.format(number, libphonenumber.PhoneNumberFormat.E164);

as answered here: https://github.com/ruimarinho/google-libphonenumber/issues/17#issuecomment-121340131

Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Matthew Michaud