yup-phone-js
Version:
Add Yup validation for phone numbers
13 lines (12 loc) • 505 B
TypeScript
import { YupPhoneOptions } from "./YupPhoneOptions";
declare module "yup" {
interface StringSchema {
/**
* Check the string is a valid phone number
*
* @param {YupPhoneOptions|undefined} [options=undefined] The options for the validation
* @param {String} [errorMessage=DEFAULT_MESSAGE] The error message for if the validation fails.
*/
phone(options?: YupPhoneOptions | undefined, errorMessage?: string): StringSchema;
}
}