Skip to content

astranavt/msisdn-formatter

 
 

Repository files navigation

@megafon/msisdn-formatter

npm (scoped with tag) msisdn CI

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.

About

Russian msisdn formatter utils.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 98.4%
  • Shell 1.6%