Huge News!Announcing our $40M Series B led by Abstract Ventures.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.0 to 1.1.1

35

contact/phone.js

@@ -20,14 +20,23 @@ "use strict";

if (this.phone.length > 2) {
phone = this.phone.substring(0, 2) + ' ' + this.phone.substring(2, 4);
switch (this.phone.length) {
case 10:
phone = phone.replace('/^(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})$/', '$1 $2 $3 $4 $5', phone);
break;
case 11:
phone = phone.replace('/^(\d{3})(\d{2})(\d{2})(\d{2})(\d{2})$/', '$1 $2 $3 $4 $5', phone);
break;
case 12:
phone = phone.replace('/^(\d{2})(\d{3})(\d{3})(\d{3})$/', '$1 $2 $3 $4', phone);
break;
case 13:
phone = phone.replace('/^(\+\d{2})(\d{3})(\d{3})(\d{3})$/', '$1 $2 $3 $4', phone);
break;
}
if (this.phone.length > 4) {
phone = phone + ' ' + this.phone.substring(4, 6);
}
if (this.phone.length > 6) {
phone = phone + ' ' + this.phone.substring(6, 8);
}
if (this.phone.length > 8) {
phone = phone + ' ' + this.phone.substring(8, 10);
}

@@ -39,3 +48,3 @@ return phone;

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

@@ -45,3 +54,3 @@ }

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

@@ -48,0 +57,0 @@ }

{
"name": "frontello-datas-format",
"version": "1.1.0",
"version": "1.1.1",
"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