All files / validator/yupTypes string.ts

0% Statements 0/0
0% Branches 0/0
0% Functions 0/0
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47                                                                                             
import { MixedLocale, StringLocale } from './Locale'
import { MixedSchema } from './mixed'
import { Refable } from './ref'
 
export interface StringSchema<T extends string = string>
  extends MixedSchema<T> {
  required(message?: MixedLocale['required']): this
 
  length(limit: Refable<number>, message?: StringLocale['length']): this
 
  min(limit: Refable<number>, message?: StringLocale['min']): this
 
  max(limit: Refable<number>, message?: StringLocale['max']): this
 
  matches(regex: RegExp, message?: StringLocale['matches']): this
 
  matches(
    regex: RegExp,
    options?: {
      excludeEmptyString?: boolean
      message?: StringLocale['matches']
    },
  ): this
 
  email(message?: StringLocale['email']): this
 
  url(message?: StringLocale['url']): this
 
  ensure(): this
 
  trim(message?: StringLocale['trim']): this
 
  lowercase(message?: StringLocale['lowercase']): this
 
  uppercase(message?: StringLocale['uppercase']): this
 
  chineseMobilePhoneNumber(
    message?: StringLocale['chineseMobilePhoneNumber'],
  ): this
 
  chineseIDCardNumber(message?: StringLocale['chineseIDCardNumber']): this
}
 
export declare function string<T extends string = string>(
  payload?: (schema: StringSchema<T>) => StringSchema<T>,
): StringSchema<T>