UNPKG

@thiagodelgado111/yup-phone

Version:

Adds a phone number validation check to yup validator using google-libphonenumber.

10 lines (9 loc) 380 B
import { StringSchema } from 'yup'; declare module 'yup' { interface StringSchema { phone(countryCode?: string, strict?: boolean): StringSchema; } } declare const YUP_METHOD = "phone"; declare function phoneValidationMethod(this: StringSchema, countryCode?: string, strict?: boolean): StringSchema<string>; export { YUP_METHOD, phoneValidationMethod as default };