Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

parse-phone

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-phone - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

6

index.js

@@ -245,10 +245,6 @@ const dialingCodes = [

module.exports = (phoneStr) => {
const data = {success: true}
const matches = dialingCodes.filter(code=>phoneStr.startsWith(code))
if (matches.length == 0) return {success: false}
data.dialCode = matches[0]
data.full = phoneStr
data.phone = phoneStr.replace(matches[0], '')
return data
return { success: true, dialCode: matches[0], full: phoneStr, phone: phoneStr.replace(matches[0], '') }
}

3

package.json
{
"name": "parse-phone",
"version": "0.0.4",
"version": "0.0.5",
"description": "phone string parser",

@@ -26,2 +26,3 @@ "main": "index.js",

"keywords": [
"international",
"phone",

@@ -28,0 +29,0 @@ "parse",

@@ -7,3 +7,3 @@ # parse-phone

phone parser for country dialing code parsing from full string
phone parser for international dialing code parsing from full string

@@ -26,2 +26,9 @@ ## Installation

parsePhone('+18096958000')
{ success: true,
dialCode: '+1809',
full: '+18096958000',
phone: '6958000' }
```

@@ -28,0 +35,0 @@

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