/**
 * Pattern to match formatted CEP (99999-999) or 8 numbers.
 */ const CEP_PATTERN = /^(\d{8}|\d{2}\.?\d{3}\-\d{3})$/ ; example param value const isCEP = ( value ) : boolean => CEP_PATTERN . test ( value ) ; export default isCEP ;