Socket
Socket
Sign inDemoInstall

phones

Package Overview
Dependencies
3
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.0 to 1.0.1

8

index.js

@@ -13,3 +13,9 @@ 'use strict'

separator = separator == null ? ' ' : separator
return separate(phone, separator, [3, 6])
var country = phone.charAt(0) === '1'
phone = phone.substring(0, country ? 11 : 10)
var separators = country ? [1, 4, 7] : [3, 6]
return separate(phone, separator, separators)
}

@@ -16,0 +22,0 @@

2

package.json
{
"name": "phones",
"main": "index.js",
"version": "1.0.0",
"version": "1.0.1",
"description": "Parse, format, and validate US phone numbers",

@@ -6,0 +6,0 @@ "license": "MIT",

@@ -41,3 +41,3 @@ # phones [![Build Status](https://travis-ci.org/bendrucker/phones.svg?branch=master)](https://travis-ci.org/bendrucker/phones)

Format a 10 digit phone string by adding separators.
Format a 10 digit phone string by adding separators and truncating extra digits.

@@ -44,0 +44,0 @@ ##### phone

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc