import mapToNumeric from '../helpers/mapToNumeric' ; example param value const formatToCPF = ( value ) : string => ( mapToNumeric ( value ) . replace ( /(\d{3})(\d)/ , '$1.$2' ) . replace ( /(\d{3})(\d)/ , '$1.$2' ) . replace ( /(\d{3})(\d{1,2})$/ , '$1-$2' ) ) ; export default formatToCPF ;