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.21 to 0.4.22

19

build/as you type.js

@@ -213,3 +213,3 @@ 'use strict';

if (!this.should_format()) {
return this.non_formatted_number();
return this.format_as_non_formatted_number();
}

@@ -236,6 +236,13 @@

}, {
key: 'non_formatted_number',
value: function non_formatted_number() {
key: 'format_as_non_formatted_number',
value: function format_as_non_formatted_number() {
if (this.is_international() && this.country_phone_code) {
if (this.national_number) {
// For convenience, the public `.template` property
// contains the whole international number
// if the phone number being input is international:
// 'x' for the '+' sign, 'x'es for the country phone code,
// a spacebar and then the template for the national number digits.
this.template = DIGIT_PLACEHOLDER + repeat(DIGIT_PLACEHOLDER, this.country_phone_code.length) + ' ' + repeat(DIGIT_PLACEHOLDER, this.national_number.length);
return '+' + this.country_phone_code + ' ' + this.national_number;

@@ -690,4 +697,6 @@ }

// For convenience, the public `.template` property
// is gonna contain the whole international number
// if the phone number being input is international.
// contains the whole international number
// if the phone number being input is international:
// 'x' for the '+' sign, 'x'es for the country phone code,
// a spacebar and then the template for the formatted national number.
if (this.is_international()) {

@@ -694,0 +703,0 @@ this.template = DIGIT_PLACEHOLDER + repeat(DIGIT_PLACEHOLDER, this.country_phone_code.length) + ' ' + template;

@@ -191,3 +191,3 @@ import _getIterator from 'babel-runtime/core-js/get-iterator';

if (!this.should_format()) {
return this.non_formatted_number();
return this.format_as_non_formatted_number();
}

@@ -214,6 +214,13 @@

}, {
key: 'non_formatted_number',
value: function non_formatted_number() {
key: 'format_as_non_formatted_number',
value: function format_as_non_formatted_number() {
if (this.is_international() && this.country_phone_code) {
if (this.national_number) {
// For convenience, the public `.template` property
// contains the whole international number
// if the phone number being input is international:
// 'x' for the '+' sign, 'x'es for the country phone code,
// a spacebar and then the template for the national number digits.
this.template = DIGIT_PLACEHOLDER + repeat(DIGIT_PLACEHOLDER, this.country_phone_code.length) + ' ' + repeat(DIGIT_PLACEHOLDER, this.national_number.length);
return '+' + this.country_phone_code + ' ' + this.national_number;

@@ -668,4 +675,6 @@ }

// For convenience, the public `.template` property
// is gonna contain the whole international number
// if the phone number being input is international.
// contains the whole international number
// if the phone number being input is international:
// 'x' for the '+' sign, 'x'es for the country phone code,
// a spacebar and then the template for the formatted national number.
if (this.is_international()) {

@@ -672,0 +681,0 @@ this.template = DIGIT_PLACEHOLDER + repeat(DIGIT_PLACEHOLDER, this.country_phone_code.length) + ' ' + template;

{
"name": "libphonenumber-js",
"version": "0.4.21",
"version": "0.4.22",
"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