UNPKG

multiform-validator

Version:

Javascript library made to validate, several form fields, such as: email, images, phone, password, cpf etc.

17 lines (16 loc) 715 B
import type { ValidateFunctions } from "./types"; /** * @param phoneNumber * @param errorMsg optional * @example validateBRPhoneNumber('(11) 98765-4321'); * @example validateBRPhoneNumber('(11) 98765-4321', ['Invalid phone number', 'Invalid format']); * @description This function returns three errors in the following order: * * Default: * ['Field phone number cannot be empty', 'Invalid phone number'] * * Create a list of errors separated by commas in strings * @returns An object with 'isValid' (boolean) and 'errorMsg' (string) properties. */ declare function validateBRPhoneNumber(phoneNumber: string, errorMsg?: (string | null)[] | null): ValidateFunctions; export default validateBRPhoneNumber;