@megafon/msisdn-formatter
TypeScript icon, indicating that this package has built-in type declarations

0.4.0 • Public • Published

@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.

Readme

Keywords

none

Package Sidebar

Install

npm i @megafon/msisdn-formatter

Weekly Downloads

2

Version

0.4.0

License

MIT

Unpacked Size

12 kB

Total Files

6

Last publish

Collaborators

  • balffr
  • dmitrylobasov
  • myfka
  • ifonin
  • hq-lk-admins
  • ns3777k