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.2.16 to 0.2.17

27

build/as you type.js

@@ -334,3 +334,2 @@ 'use strict';

this.last_match_position = -1;
this.national_prefix_is_part_of_formatting_template = false;
}

@@ -464,8 +463,2 @@

var number_pattern = this.validate_format(format);
if (!number_pattern) {
continue;
}
if (discard_national_prefix) {

@@ -479,6 +472,18 @@ this.national_number = this.national_prefix + this.national_number;

this.chosen_format = format;
this.create_formatting_template(format, number_pattern);
this.reformat_national_number();
return (0, _format.format_national_number_using_format)(this.national_number, format, this.is_international(), this.national_prefix, this.country_metadata);
var number_pattern = this.validate_format(format);
var formatted_number = (0, _format.format_national_number_using_format)(this.national_number, format, this.is_international(), this.national_prefix, this.country_metadata);
if (number_pattern) {
// Set `this.template` and `this.partially_populated_template`
this.create_formatting_template(format, number_pattern);
// Populate `this.partially_populated_template`
this.reformat_national_number();
} else {
this.template = formatted_number.replace(/[\d\+]/g, DIGIT_PLACEHOLDER);
this.partially_populated_template = formatted_number;
}
return formatted_number;
}

@@ -678,3 +683,2 @@ } catch (err) {

var number_format = this.get_format_format(format);
this.national_prefix_is_part_of_formatting_template = false;

@@ -691,3 +695,2 @@ // If the user did input the national prefix

number_format = number_format.replace(_format.FIRST_GROUP_PATTERN, national_prefix_formatting_rule);
this.national_prefix_is_part_of_formatting_template = true;
}

@@ -694,0 +697,0 @@ }

{
"name": "libphonenumber-js",
"version": "0.2.16",
"version": "0.2.17",
"description": "A simpler (and smaller) rewrite of Google Android's popular libphonenumber library",

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

@@ -377,3 +377,2 @@ // This is an enhanced port of Google Android `libphonenumber`'s

this.last_match_position = -1
this.national_prefix_is_part_of_formatting_template = false
}

@@ -511,9 +510,2 @@

const number_pattern = this.validate_format(format)
if (!number_pattern)
{
continue
}
if (discard_national_prefix)

@@ -528,6 +520,6 @@ {

this.chosen_format = format
this.create_formatting_template(format, number_pattern)
this.reformat_national_number()
return format_national_number_using_format
const number_pattern = this.validate_format(format)
const formatted_number = format_national_number_using_format
(

@@ -540,2 +532,17 @@ this.national_number,

)
if (number_pattern)
{
// Set `this.template` and `this.partially_populated_template`
this.create_formatting_template(format, number_pattern)
// Populate `this.partially_populated_template`
this.reformat_national_number()
}
else
{
this.template = formatted_number.replace(/[\d\+]/g, DIGIT_PLACEHOLDER)
this.partially_populated_template = formatted_number
}
return formatted_number
}

@@ -705,3 +712,2 @@ }

let number_format = this.get_format_format(format)
this.national_prefix_is_part_of_formatting_template = false

@@ -720,3 +726,2 @@ // If the user did input the national prefix

number_format = number_format.replace(FIRST_GROUP_PATTERN, national_prefix_formatting_rule)
this.national_prefix_is_part_of_formatting_template = true
}

@@ -723,0 +728,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

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