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.13 to 0.4.14

15

build/as you type.js

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

// getting into the output of the "as you type formatter".
var ELIGIBLE_FORMAT_PATTERN = new RegExp('^' + '[' + _parse.VALID_PUNCTUATION + ']*' + '(\\$\\d[' + _parse.VALID_PUNCTUATION + ']*)+' + '$');
var ELIGIBLE_FORMAT_PATTERN = new RegExp('^' + '[' + _parse.VALID_PUNCTUATION_AND_WHITESPACE + ']*' + '(\\$\\d[' + _parse.VALID_PUNCTUATION_AND_WHITESPACE + ']*)+' + '$');

@@ -80,3 +80,3 @@ // This is the minimum length of the leading digits of a phone number

var VALID_INCOMPLETE_PHONE_NUMBER = '[' + _parse.PLUS_CHARS + ']{0,1}' + '[' + _parse.VALID_PUNCTUATION + _parse.VALID_DIGITS + ']*';
var VALID_INCOMPLETE_PHONE_NUMBER = '[' + _parse.PLUS_CHARS + ']{0,1}' + '[' + _parse.VALID_PUNCTUATION_AND_WHITESPACE + _parse.VALID_DIGITS + ']*';

@@ -469,3 +469,3 @@ var VALID_INCOMPLETE_PHONE_NUMBER_PATTERN = new RegExp('^' + VALID_INCOMPLETE_PHONE_NUMBER + '$', 'i');

// Set `this.template` and `this.partially_populated_template`
// Set `this.template` and `this.partially_populated_template`.
//

@@ -481,4 +481,4 @@ // `else` case doesn't ever happen

} else {
// Prepend `+CountryCode` in case of an international phone number
var full_number = this.full_phone_number(formatted_number);
this.template = full_number.replace(/[\d\+]/g, DIGIT_PLACEHOLDER);

@@ -506,3 +506,3 @@ this.partially_populated_template = full_number;

// Combines the national number with the appropriate prefix
// Prepends `+CountryCode` in case of an international phone number

@@ -693,2 +693,7 @@ }, {

// Also remove braces for the international phone number format
if (this.is_international()) {
template = template.replace(new RegExp('[' + _parse.VALID_PUNCTUATION + ']+', 'g'), '');
}
// This one is for national number only

@@ -695,0 +700,0 @@ this.partially_populated_template = template;

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

});
exports.VALID_PUNCTUATION = exports.VALID_DIGITS = exports.PLUS_CHARS = undefined;
exports.VALID_PUNCTUATION_AND_WHITESPACE = exports.VALID_PUNCTUATION = exports.VALID_DIGITS = exports.PLUS_CHARS = undefined;

@@ -62,3 +62,4 @@ var _getIterator2 = require('babel-runtime/core-js/get-iterator');

// parentheses and tildes. Full-width variants are also present.
var VALID_PUNCTUATION = exports.VALID_PUNCTUATION = '' + DASHES + SLASHES + DOTS + WHITESPACE + BRACKETS + TILDES;
var VALID_PUNCTUATION = exports.VALID_PUNCTUATION = '' + DASHES + SLASHES + DOTS + BRACKETS + TILDES;
var VALID_PUNCTUATION_AND_WHITESPACE = exports.VALID_PUNCTUATION_AND_WHITESPACE = '' + VALID_PUNCTUATION + WHITESPACE;

@@ -85,3 +86,4 @@ // Regular expression of viable phone numbers. This is location independent.

//
// Note VALID_PUNCTUATION starts with a -, so must be the first in the range.
// "Note VALID_PUNCTUATION_AND_WHITESPACE starts with a -,
// so must be the first in the range" (c) Google devs.
// (wtf did they mean by saying that; probably nothing)

@@ -94,3 +96,3 @@ //

//
var VALID_PHONE_NUMBER = '[' + PLUS_CHARS + ']{0,1}' + '(?:' + '[' + VALID_PUNCTUATION + ']*' + '[' + VALID_DIGITS + ']' + '){3,}' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']*';
var VALID_PHONE_NUMBER = '[' + PLUS_CHARS + ']{0,1}' + '(?:' + '[' + VALID_PUNCTUATION_AND_WHITESPACE + ']*' + '[' + VALID_DIGITS + ']' + '){3,}' + '[' + VALID_PUNCTUATION_AND_WHITESPACE + VALID_DIGITS + ']*';

@@ -97,0 +99,0 @@ // The combined regular expression for valid phone numbers:

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

import { VALID_PUNCTUATION, PLUS_SIGN, PLUS_CHARS, VALID_DIGITS, extract_formatted_phone_number, parse_phone_number, parse_phone_number_and_country_phone_code, find_country_code, strip_national_prefix } from './parse';
import { VALID_PUNCTUATION, VALID_PUNCTUATION_AND_WHITESPACE, PLUS_SIGN, PLUS_CHARS, VALID_DIGITS, extract_formatted_phone_number, parse_phone_number, parse_phone_number_and_country_phone_code, find_country_code, strip_national_prefix } from './parse';

@@ -51,3 +51,3 @@ import { FIRST_GROUP_PATTERN, format_national_number_using_format, local_to_international_style } from './format';

// getting into the output of the "as you type formatter".
var ELIGIBLE_FORMAT_PATTERN = new RegExp('^' + '[' + VALID_PUNCTUATION + ']*' + '(\\$\\d[' + VALID_PUNCTUATION + ']*)+' + '$');
var ELIGIBLE_FORMAT_PATTERN = new RegExp('^' + '[' + VALID_PUNCTUATION_AND_WHITESPACE + ']*' + '(\\$\\d[' + VALID_PUNCTUATION_AND_WHITESPACE + ']*)+' + '$');

@@ -59,3 +59,3 @@ // This is the minimum length of the leading digits of a phone number

var VALID_INCOMPLETE_PHONE_NUMBER = '[' + PLUS_CHARS + ']{0,1}' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']*';
var VALID_INCOMPLETE_PHONE_NUMBER = '[' + PLUS_CHARS + ']{0,1}' + '[' + VALID_PUNCTUATION_AND_WHITESPACE + VALID_DIGITS + ']*';

@@ -448,3 +448,3 @@ var VALID_INCOMPLETE_PHONE_NUMBER_PATTERN = new RegExp('^' + VALID_INCOMPLETE_PHONE_NUMBER + '$', 'i');

// Set `this.template` and `this.partially_populated_template`
// Set `this.template` and `this.partially_populated_template`.
//

@@ -460,4 +460,4 @@ // `else` case doesn't ever happen

} else {
// Prepend `+CountryCode` in case of an international phone number
var full_number = this.full_phone_number(formatted_number);
this.template = full_number.replace(/[\d\+]/g, DIGIT_PLACEHOLDER);

@@ -485,3 +485,3 @@ this.partially_populated_template = full_number;

// Combines the national number with the appropriate prefix
// Prepends `+CountryCode` in case of an international phone number

@@ -672,2 +672,7 @@ }, {

// Also remove braces for the international phone number format
if (this.is_international()) {
template = template.replace(new RegExp('[' + VALID_PUNCTUATION + ']+', 'g'), '');
}
// This one is for national number only

@@ -674,0 +679,0 @@ this.partially_populated_template = template;

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

// parentheses and tildes. Full-width variants are also present.
export var VALID_PUNCTUATION = '' + DASHES + SLASHES + DOTS + WHITESPACE + BRACKETS + TILDES;
export var VALID_PUNCTUATION = '' + DASHES + SLASHES + DOTS + BRACKETS + TILDES;
export var VALID_PUNCTUATION_AND_WHITESPACE = '' + VALID_PUNCTUATION + WHITESPACE;

@@ -59,3 +60,4 @@ // Regular expression of viable phone numbers. This is location independent.

//
// Note VALID_PUNCTUATION starts with a -, so must be the first in the range.
// "Note VALID_PUNCTUATION_AND_WHITESPACE starts with a -,
// so must be the first in the range" (c) Google devs.
// (wtf did they mean by saying that; probably nothing)

@@ -68,3 +70,3 @@ //

//
var VALID_PHONE_NUMBER = '[' + PLUS_CHARS + ']{0,1}' + '(?:' + '[' + VALID_PUNCTUATION + ']*' + '[' + VALID_DIGITS + ']' + '){3,}' + '[' + VALID_PUNCTUATION + VALID_DIGITS + ']*';
var VALID_PHONE_NUMBER = '[' + PLUS_CHARS + ']{0,1}' + '(?:' + '[' + VALID_PUNCTUATION_AND_WHITESPACE + ']*' + '[' + VALID_DIGITS + ']' + '){3,}' + '[' + VALID_PUNCTUATION_AND_WHITESPACE + VALID_DIGITS + ']*';

@@ -71,0 +73,0 @@ // The combined regular expression for valid phone numbers:

{
"name": "libphonenumber-js",
"version": "0.4.13",
"version": "0.4.14",
"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 not supported yet

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

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