Skip to content

v3.2.46

Latest

Choose a tag to compare

@github-actions github-actions released this 30 Jul 23:06

Behaviour change

format() now prepends the country calling code when formatting an unparseable number as E164, provided the number kept its raw input and its country code came from FROM_DEFAULT_COUNTRY. Previously the raw input was returned unchanged.

const phoneUtil = require('google-libphonenumber').PhoneNumberUtil.getInstance();
const PNF = require('google-libphonenumber').PhoneNumberFormat;

phoneUtil.format(phoneUtil.parse('000', 'AU'), PNF.E164);
// 3.2.45 => '000'
// 3.2.46 => '+61000'

This comes from upstream libphonenumber v9.0.35, which added testFormatAUShortCodeNumber to cover it. In practice it affects emergency numbers and short codes formatted as E164 against a default region. Despite being a patch release, the output does change for those inputs, so pin to 3.2.45 if you depend on the previous behaviour.

What's Changed

Full Changelog: v3.2.45...v3.2.46