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 1.9.40 to 1.9.41

18

build/AsYouTypeFormatter.js

@@ -396,6 +396,18 @@ "use strict";

if (leadingDigits.length < MIN_LEADING_DIGITS_LENGTH) {
return new _AsYouTypeFormatter3["default"](leadingDigitsPattern).match(leadingDigits, {
allowOverflow: true
}) !== undefined; // Before leading digits < 3 matching was implemented:
// Before leading digits < 3 matching was implemented:
// return true
//
// After leading digits < 3 matching was implemented:
try {
return new _AsYouTypeFormatter3["default"](leadingDigitsPattern).match(leadingDigits, {
allowOverflow: true
}) !== undefined;
} catch (error) {
// There's a slight possibility that there could be some undiscovered bug
// in the pattern matcher code. Since the "leading digits < 3 matching"
// feature is not "essential" for operation, it can fall back to the old way
// in case of any issues rather than halting the application's execution.
console.error(error);
return true;
}
} // If at least `MIN_LEADING_DIGITS_LENGTH` digits of a national number are

@@ -402,0 +414,0 @@ // available then use the usual regular expression matching.

@@ -373,6 +373,18 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

if (leadingDigits.length < MIN_LEADING_DIGITS_LENGTH) {
return new PatternMatcher(leadingDigitsPattern).match(leadingDigits, {
allowOverflow: true
}) !== undefined; // Before leading digits < 3 matching was implemented:
// Before leading digits < 3 matching was implemented:
// return true
//
// After leading digits < 3 matching was implemented:
try {
return new PatternMatcher(leadingDigitsPattern).match(leadingDigits, {
allowOverflow: true
}) !== undefined;
} catch (error) {
// There's a slight possibility that there could be some undiscovered bug
// in the pattern matcher code. Since the "leading digits < 3 matching"
// feature is not "essential" for operation, it can fall back to the old way
// in case of any issues rather than halting the application's execution.
console.error(error);
return true;
}
} // If at least `MIN_LEADING_DIGITS_LENGTH` digits of a national number are

@@ -379,0 +391,0 @@ // available then use the usual regular expression matching.

2

package.json
{
"name": "libphonenumber-js",
"version": "1.9.40",
"version": "1.9.41",
"description": "A simpler (and smaller) rewrite of Google Android's libphonenumber library in javascript",

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

@@ -320,5 +320,16 @@ import {

if (leadingDigits.length < MIN_LEADING_DIGITS_LENGTH) {
return new PatternMatcher(leadingDigitsPattern).match(leadingDigits, { allowOverflow: true }) !== undefined
// Before leading digits < 3 matching was implemented:
// return true
//
// After leading digits < 3 matching was implemented:
try {
return new PatternMatcher(leadingDigitsPattern).match(leadingDigits, { allowOverflow: true }) !== undefined
} catch (error) {
// There's a slight possibility that there could be some undiscovered bug
// in the pattern matcher code. Since the "leading digits < 3 matching"
// feature is not "essential" for operation, it can fall back to the old way
// in case of any issues rather than halting the application's execution.
console.error(error)
return true
}
}

@@ -325,0 +336,0 @@

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 too big to display

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 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