New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

frontello-datas-format

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

frontello-datas-format - npm Package Compare versions

Comparing version 1.1.7 to 1.1.8

53

contact/phone.js

@@ -20,24 +20,29 @@ "use strict";

phone = phone.replace(/\D/g, '');
switch (this.phone.length) {
case 10:
phone = phone.replace(/^(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$/, '$1 $2 $3 $4 $5');
break;
case 11:
phone = phone.replace(/^(\d{3})(\d{2})(\d{2})(\d{2})(\d{2})$/, '$1 $2 $3 $4 $5');
break;
case 12:
phone = phone.replace(/^(\d{2})(\d{3})(\d{3})(\d{3})$/, '$1 $2 $3 $4');
break;
case 13:
phone = phone.replace(/^(\+\d{2})(\d{3})(\d{3})(\d{3})$/, '$1 $2 $3 $4');
break;
phone = phone.replace(/[^\+0-9]/g, '');
if ('+' == phone.charAt(0)) {
// format E.164
phone = phone.replace(/^(\+\d{2})(\d{1})(\d{2})(\d{2})(\d{2})(\d{2})$/, '$1 $2 $3 $4 $5 $6');
} else {
switch (this.phone.length) {
case 10:
phone = phone.replace(/^(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$/, '$1 $2 $3 $4 $5');
break;
case 11:
phone = phone.replace(/^(\d{3})(\d{2})(\d{2})(\d{2})(\d{2})$/, '$1 $2 $3 $4 $5');
break;
case 12:
phone = phone.replace(/^(\d{2})(\d{3})(\d{3})(\d{3})$/, '$1 $2 $3 $4');
break;
case 13:
phone = phone.replace(/^(\+\d{2})(\d{3})(\d{3})(\d{3})$/, '$1 $2 $3 $4');
break;
}
}

@@ -52,3 +57,3 @@

{
if (!/^(33|0)([0-9]{9})$/.test(this.phone)) {
if (!/^(\+33|0)([0-9]{9})$/.test(this.phone)) {
return false;

@@ -58,3 +63,3 @@ }

if (mobile) {
if (!/^(33|0)([6|7])([0-9]{8})$/.test(this.phone)) {
if (!/^(\+33|0)([6|7])([0-9]{8})$/.test(this.phone)) {
return false;

@@ -61,0 +66,0 @@ }

{
"name": "frontello-datas-format",
"version": "1.1.7",
"version": "1.1.8",
"description": "UI format",

@@ -5,0 +5,0 @@ "main": "format.js",

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