Skip to content
This repository was archived by the owner on Aug 29, 2023. It is now read-only.

lafayette/fix-phone

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

192 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fix-phone

Build Status Coverage Status

Validate and format phone number, or return nothing, if such phone is not valid.

Installation

npm i fix-phone --save

Usage

var fix = require('fix-phone');

fix('ua', '050-121-22-33'); // returns +380501212233
fix('ua', '010-121-22-33'); // returns null

fix.decompose('ua', '050-121-22-33'); // returns { country: '+380', local: '50', phone: '1212233' }
fix.decompose('ua', '010-121-22-33'); // returns null

Supported country codes

Take look at country modules directory.

Contributors

License

MIT

About

Validate and format phone number, or return nothing, if such phone is not valid.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%