- getRules(): {
compareNumber: ((comparator:
| "lt"
| "gt"
| "gte"
| "lte"
| "eq"
| "neq", nb: number) => RuleFunction<number | undefined | null>);
email: ((value?: null | string) => string | boolean);
isAfterDay: ((date: Date, include?: boolean) => ((value?: null | Date) => string | true));
isAfterToday: ((include?: boolean) => ((value?: null | Date) => true | "Date must be today or later" | "Date must be after today"));
isBetweenDays: ((minDate: Date, maxDate: Date, include?: boolean) => ((value?: null | Date) => string | true));
isCode: ((value?: null | string) => string | boolean);
isDateBetweenHours: ((minHour?: number, maxHour?: number, include?: boolean) => ((date?: null | Date) => string | true));
isInteger: ((strict?: boolean) => ((value?: null | string | number) => string | boolean));
isNumber: ((value?: null | string | number) => string | boolean);
isSlug: ((value?: null | string) => string | boolean);
isWeekDay: ((date?: null | Date) => true | "Must be a weekday");
lowercase: ((value?: null | string) => string | boolean);
max: ((nb: number, eq?: boolean) => RuleFunction<undefined | null | number>);
maxLength: ((length: number) => ((value?: null | string | any[]) => string | true));
min: ((nb: number, eq?: boolean) => RuleFunction<undefined | null | number>);
minLength: ((length: number) => ((value?: null | string | any[]) => string | true));
nonEmptyString: ((value?: null | string) => string | boolean);
nonZero: ((value?: null | number) => string | boolean);
phone: ((value?: null | string | number) => string | boolean);
required: ((value?: any) => string | boolean);
} Returns {
compareNumber: ((comparator:
| "lt"
| "gt"
| "gte"
| "lte"
| "eq"
| "neq", nb: number) => RuleFunction<number | undefined | null>);
email: ((value?: null | string) => string | boolean);
isAfterDay: ((date: Date, include?: boolean) => ((value?: null | Date) => string | true));
isAfterToday: ((include?: boolean) => ((value?: null | Date) => true | "Date must be today or later" | "Date must be after today"));
isBetweenDays: ((minDate: Date, maxDate: Date, include?: boolean) => ((value?: null | Date) => string | true));
isCode: ((value?: null | string) => string | boolean);
isDateBetweenHours: ((minHour?: number, maxHour?: number, include?: boolean) => ((date?: null | Date) => string | true));
isInteger: ((strict?: boolean) => ((value?: null | string | number) => string | boolean));
isNumber: ((value?: null | string | number) => string | boolean);
isSlug: ((value?: null | string) => string | boolean);
isWeekDay: ((date?: null | Date) => true | "Must be a weekday");
lowercase: ((value?: null | string) => string | boolean);
max: ((nb: number, eq?: boolean) => RuleFunction<undefined | null | number>);
maxLength: ((length: number) => ((value?: null | string | any[]) => string | true));
min: ((nb: number, eq?: boolean) => RuleFunction<undefined | null | number>);
minLength: ((length: number) => ((value?: null | string | any[]) => string | true));
nonEmptyString: ((value?: null | string) => string | boolean);
nonZero: ((value?: null | number) => string | boolean);
phone: ((value?: null | string | number) => string | boolean);
required: ((value?: any) => string | boolean);
}
compareNumber: ((comparator:
| "lt"
| "gt"
| "gte"
| "lte"
| "eq"
| "neq", nb: number) => RuleFunction<number | undefined | null>)
- (comparator, nb): RuleFunction<number | undefined | null>
Parameters
- comparator:
| "lt"
| "gt"
| "gte"
| "lte"
| "eq"
| "neq" - nb: number
Returns RuleFunction<number | undefined | null>
email: ((value?: null | string) => string | boolean)
- (value?): string | boolean
Parameters
Optional
value: null | string
Returns string | boolean
isAfterDay: ((date: Date, include?: boolean) => ((value?: null | Date) => string | true))
- (date, include?): ((value?: null | Date) => string | true)
Parameters
- date: Date
- include: boolean = true
Returns ((value?: null | Date) => string | true)
- (value?): string | true
Parameters
Optional
value: null | Date
Returns string | true
isAfterToday: ((include?: boolean) => ((value?: null | Date) => true | "Date must be today or later" | "Date must be after today"))
- (include?): ((value?: null | Date) => true | "Date must be today or later" | "Date must be after today")
Returns ((value?: null | Date) => true | "Date must be today or later" | "Date must be after today")
- (value?): true | "Date must be today or later" | "Date must be after today"
Parameters
Optional
value: null | Date
Returns true | "Date must be today or later" | "Date must be after today"
isBetweenDays: ((minDate: Date, maxDate: Date, include?: boolean) => ((value?: null | Date) => string | true))
- (minDate, maxDate, include?): ((value?: null | Date) => string | true)
Parameters
- minDate: Date
- maxDate: Date
- include: boolean = true
Returns ((value?: null | Date) => string | true)
- (value?): string | true
Parameters
Optional
value: null | Date
Returns string | true
isCode: ((value?: null | string) => string | boolean)
- (value?): string | boolean
Parameters
Optional
value: null | string
Returns string | boolean
isDateBetweenHours: ((minHour?: number, maxHour?: number, include?: boolean) => ((date?: null | Date) => string | true))
- (minHour?, maxHour?, include?): ((date?: null | Date) => string | true)
Parameters
- minHour: number = 0
- maxHour: number = 24
- include: boolean = true
Returns ((date?: null | Date) => string | true)
- (date?): string | true
Parameters
Optional
date: null | Date
Returns string | true
isInteger: ((strict?: boolean) => ((value?: null | string | number) => string | boolean))
- (strict?): ((value?: null | string | number) => string | boolean)
Returns ((value?: null | string | number) => string | boolean)
- (value?): string | boolean
Parameters
Optional
value: null | string | number
Returns string | boolean
isNumber: ((value?: null | string | number) => string | boolean)
- (value?): string | boolean
Parameters
Optional
value: null | string | number
Returns string | boolean
isSlug: ((value?: null | string) => string | boolean)
- (value?): string | boolean
Parameters
Optional
value: null | string
Returns string | boolean
isWeekDay: ((date?: null | Date) => true | "Must be a weekday")
- (date?): true | "Must be a weekday"
Parameters
Optional
date: null | Date
Returns true | "Must be a weekday"
lowercase: ((value?: null | string) => string | boolean)
- (value?): string | boolean
Parameters
Optional
value: null | string
Returns string | boolean
max: ((nb: number, eq?: boolean) => RuleFunction<undefined | null | number>)
- (nb, eq?): RuleFunction<undefined | null | number>
Parameters
- nb: number
- eq: boolean = true
Returns RuleFunction<undefined | null | number>
maxLength: ((length: number) => ((value?: null | string | any[]) => string | true))
- (length): ((value?: null | string | any[]) => string | true)
Returns ((value?: null | string | any[]) => string | true)
- (value?): string | true
Parameters
Optional
value: null | string | any[]
Returns string | true
min: ((nb: number, eq?: boolean) => RuleFunction<undefined | null | number>)
- (nb, eq?): RuleFunction<undefined | null | number>
Parameters
- nb: number
- eq: boolean = true
Returns RuleFunction<undefined | null | number>
minLength: ((length: number) => ((value?: null | string | any[]) => string | true))
- (length): ((value?: null | string | any[]) => string | true)
Returns ((value?: null | string | any[]) => string | true)
- (value?): string | true
Parameters
Optional
value: null | string | any[]
Returns string | true
nonEmptyString: ((value?: null | string) => string | boolean)
- (value?): string | boolean
Parameters
Optional
value: null | string
Returns string | boolean
nonZero: ((value?: null | number) => string | boolean)
- (value?): string | boolean
Parameters
Optional
value: null | number
Returns string | boolean
phone: ((value?: null | string | number) => string | boolean)
- (value?): string | boolean
Parameters
Optional
value: null | string | number
Returns string | boolean
required: ((value?: any) => string | boolean)
- (value?): string | boolean
Returns string | boolean