@format-string/core
v0.3.6
Published
<p align="center"> <a href="" rel="noopener"> <img width=200px height=200px src="https://i.imgur.com/6wj0hh6.jpg" alt="Project logo"></a> </p>
Downloads
6
Readme
Table of Contents
Installation
npm i @format-string/core
yarn add @format-string/core
Usage
import { formatString } from '@format-string/core'
const formatStringCPF = formatString({ type: 'cpf', value: '00000000000' })
console.log({ formatStringCPF })
Result = { formatStringCPF: 000.000.000-00 }
Properties setMask
| Name | Type | Default | Description |
| :-----------------------------------------: | :-------------------------: | :-----: | :--------------------------------------------------------------------- |
| type
| string
| - | Mask format |
| value | string | Number | undefined
| - | string to be formatted |
|
Type
| cnpj
| cpf
| phone
| postalCode
| cpfOurCnpj
| currency
| rg
| credCard
| obscureEmail
| number
| telephone
| cardExpirationDate
Usage single visit
formatRemove : npm i @format-string/removeCPF
formatStringCPF : npm i @format-string/cpf
formatStringCNPJ : npm i @format-string/cnpj
formatStringSingleDocument : npm i @format-string/single-document
formatStringNumber : npm i @format-string/number
formatStringCurrency : npm i @format-string/currency
formatStringCredCardExpirationDate : npm i @format-string/cred-card-expiration-date
formatStringTelephone : npm i @format-string/telephone
formatStringObscureEmail : npm i @format-string/obscure-email
formatStringPostalCode: npm i @format-string/postal-code
formatStringRG : npm i @format-string/rg
formatStringPhone : npm i @format-string/phone
formatStringCredCard : npm i @format-string/cred-card
✍️ Authors
- @ReisSouza - Idea & Initial work
See also the list of contributors who participated in this project.
Thanks
Thanks to BrowserStack for the help with testing on real devices