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

phone

Package Overview
Dependencies
Maintainers
1
Versions
125
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

phone - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

8

lib/index.js

@@ -13,3 +13,3 @@ /**

phone = phone.trim();
country = country.trim();
country = (country === null) ? '' : country.trim();

@@ -573,5 +573,3 @@ if (phone.match(/^\+/)) {

if (country === null) {
iso3166 = iso3166_data[iso3_map.USA];
} else {
if (country) {
if (country.length === 3) {

@@ -608,2 +606,4 @@ //iso3

}
} else {
iso3166 = iso3166_data[iso3_map.USA];
}

@@ -610,0 +610,0 @@

{
"name": "phone",
"version": "0.0.1",
"version": "0.0.2",
"description": "With a given country and phone number, validate and format the phone number to E.164 standard",

@@ -5,0 +5,0 @@ "main": "./lib/index",

@@ -13,2 +13,9 @@ var should = require('should'),

describe("phone('+1 (817) 569-8900', null)", function() {
it('returns +18175698900', function() {
var result = phone('+1 (817) 569-8900', null);
result.should.eql('+18175698900');
});
});
describe("phone('212345678', '')", function() {

@@ -69,2 +76,9 @@ it('returns null', function() {

describe("phone('6569-8900', null)", function() {
it('returns null', function() {
var result = (phone('6569-8900', null) === null);
result.should.eql(true);
});
});
describe("phone('+852 8-569-8900', 'HKG')", function() {

@@ -71,0 +85,0 @@ it('returns +85285698900', function() {

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