brazilian-values
Version:
Validates and formats brazilian values, like money (BRL), CPF, CNPJ, dates etc.
24 lines (23 loc) • 615 B
TypeScript
/**
* Formats a phone value into brazilian common phone formats.
* @example ```js
* formatToGenericPhone('23456789')
* //=> '2345-6789'
*
* formatToGenericPhone('923456789')
* //=> '92345-6789'
*
* formatToGenericPhone('21923456789')
* //=> '(21) 92345-6789'
*
* formatToGenericPhone('021923456789')
* //=> '021 92345-6789'
*
* formatToGenericPhone('5521923456789')
* //=> '+55 21 92345-6789'
* ```
* @param value
* @param countryCodeLength
*/
declare const formatToGenericPhone: (value: string, countryCodeLength?: number) => string;
export default formatToGenericPhone;