@megafon/msisdn-formatter
v0.4.0
Published
MSISDN formatter utils
Downloads
11
Keywords
Readme
@megafon/msisdn-formatter
Russian msisdn normalizer and formatter.
Installation
$ yarn add @megafon/msisdn-formatter
Usage
import { clean, pretty, PrettyFormats } from '@megafon/msisdn-formatter';
const userNumber = '+79260000000';
console.log(clean(userNumber)); // Prints: '9260000000'
console.log(pretty(userNumber)); // Prints ZETA format by default: '+7 (926) 000-00-00'
console.log(pretty(userNumber, PrettyFormats.ETA)); // Prints: '+7 926 000-00-00'
Available formats:
- alpha: 9161234567
- beta: 79161234567
- gamma: 916 123-4567
- delta: (916) 123-4567
- epsilon: +7 (916) 123-4567
- zeta: +7 (916) 123-45-67
- eta: +7 916 123-45-67
Contributing
Follow CONTRIBUTING.md and CODE_OF_CONDUCT.md.