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

phone-formatter

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

phone-formatter - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

4

index.js

@@ -14,4 +14,4 @@ module.exports = {

// Normalize the phone number first if asked to do so in the options
if (options && options.normalize === true) {
// Normalize the phone number first unless not asked to do so in the options
if (!options || !options.normalize) {
phoneNumber = this.normalize(phoneNumber)

@@ -18,0 +18,0 @@ };

{
"name": "phone-formatter",
"description": "Parse and format telephone numbers.",
"version": "0.0.1",
"version": "0.0.2",
"homepage": "https://github.com/stevekinney/node-phone-formatter",

@@ -6,0 +6,0 @@ "author": {

@@ -29,9 +29,16 @@ # Phone Number Formatter

That's cool. Pass some extra configuration options to the format method.
That's cool. Do it.
```javascript
phoneFormatter.format("(212) 555-1212", "NNN.NNN.NNNN", {normalize: true})
phoneFormatter.format("(212) 555-1212", "NNN.NNN.NNNN")
// returns "212.555.1212"
```
If for some reason, this is not what you want: you can turn it off.
```javascript
phoneFormatter.format("(212) 555-1212", "NNN.NNN.NNNN", {normalize: false})
// Will probably crash and burn hideously. What are you even doing?
```
## Documentation

@@ -69,2 +76,3 @@

* 0.0.2: Normalize phone numbers by default.
* 0.0.1: Just two methods and some tests.

@@ -71,0 +79,0 @@

@@ -7,10 +7,10 @@ var assert = require('assert');

var testFormats = [
"(212) 555 1212",
"(212) 555.1212",
"(212) 555-1212",
"(212) 5551212",
"(212)5551212",
"212 555 1212",
"212.555.1212",
"212-555-1212",
"(212) 555 1212",
"(212) 555.1212",
"(212) 555-1212",
"(212) 5551212",
"(212)5551212",
"212 555 1212",
"212.555.1212",
"212-555-1212",
"1-212-555-1212",

@@ -20,3 +20,3 @@ "+1 (212) 555-1212",

"+45 (212) 555-1212",
"2125551212"
"2125551212"
]

@@ -124,3 +124,3 @@

assert.deepEqual(
PhoneFormatter.format("(212) 555-1212", "NNN.NNN.NNNN", {normalize: true}),
PhoneFormatter.format("(212) 555-1212", "NNN.NNN.NNNN"),
"212.555.1212"

@@ -132,2 +132,2 @@ );

});
});
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