Socket
Socket
Sign inDemoInstall

libphonenumber-js

Package Overview
Dependencies
Maintainers
1
Versions
392
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

libphonenumber-js - npm Package Compare versions

Comparing version 0.4.47 to 0.4.48

14

build/parse.js

@@ -286,4 +286,16 @@ 'use strict';

var national_number = strip_national_prefix(number, country_metadata);
var national_number = number;
// Only strip national prefixes for non-international phone numbers
// because national prefixes can't be present in international phone numbers.
// Otherwise, while forgiving, it would parse a NANPA number `+1 1877 215 5230`
// first to `1877 215 5230` and then, stripping the leading `1`, to `877 215 5230`,
// and then it would assume that's a valid number which it isn't.
// So no forgiveness for grandmas here.
// The issue asking for this fix:
// https://github.com/catamphetamine/libphonenumber-js/issues/159
if (!is_international) {
national_number = strip_national_prefix(number, country_metadata);
}
var did_have_national_prefix = national_number !== number;

@@ -290,0 +302,0 @@

@@ -261,4 +261,16 @@ import _getIterator from 'babel-runtime/core-js/get-iterator';

var national_number = strip_national_prefix(number, country_metadata);
var national_number = number;
// Only strip national prefixes for non-international phone numbers
// because national prefixes can't be present in international phone numbers.
// Otherwise, while forgiving, it would parse a NANPA number `+1 1877 215 5230`
// first to `1877 215 5230` and then, stripping the leading `1`, to `877 215 5230`,
// and then it would assume that's a valid number which it isn't.
// So no forgiveness for grandmas here.
// The issue asking for this fix:
// https://github.com/catamphetamine/libphonenumber-js/issues/159
if (!is_international) {
national_number = strip_national_prefix(number, country_metadata);
}
var did_have_national_prefix = national_number !== number;

@@ -265,0 +277,0 @@

2

package.json
{
"name": "libphonenumber-js",
"version": "0.4.47",
"version": "0.4.48",
"description": "A simpler (and smaller) rewrite of Google Android's popular libphonenumber library",

@@ -5,0 +5,0 @@ "main": "index.common.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc