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
- Add release workflow by @ruimarinho in #486
- Update vulnerable transitive dependencies by @ruimarinho in #487
- Update libphonenumber@9.0.35 by @ruimarinho in #488
Full Changelog: v3.2.45...v3.2.46