public contains(str: string): Validator
Parameters
Returns
Validator
public equals(equals: any): Validator
Parameters
Returns
Validator
Alias for regex()
Returns
Validator
public isAfter(date: Date): Validator
Argument is optional and defaults to today. Comparison is non-inclusive
Parameters
Returns
Validator
Returns
Validator
public isBefore(date: Date): Validator
Argument is optional and defaults to today. Comparison is non-inclusive
Parameters
Returns
Validator
public isCreditCard(): Validator
Will work against Visa, MasterCard, American Express, Discover, Diners Club, and JCB card numbering formats
Returns
Validator
Uses Date.parse() - regex is probably a better choice
Returns
Validator
Returns
Validator
Alias for isDecimal
Returns
Validator
public isHexColor(): Validator
Accepts valid hexcolors with or without # prefix
Returns
Validator
Combines isIPv4 and isIPv6
Returns
Validator
Returns
Validator
Returns
Validator
public isIn(options: string): Validator
Parameters
Returns
Validator
public isIn(options: Array<string>): Validator
Parameters
Returns
Validator
isNumeric accepts zero padded numbers, e.g. '001', isInt doesn't
Returns
Validator
Returns
Validator
public isUUIDv3(): Validator
Alias for isUUID(3)
Returns
Validator
public isUUIDv4(): Validator
Alias for isUUID(4)
Returns
Validator
public isUUIDv5(): Validator
Alias for isUUID(5)
Returns
Validator
Accepts http, https, ftp
Returns
Validator
public len(min: number, max?: number): Validator
max is optional
Parameters
-
min: number
-
max?: number optional
Returns
Validator
public max(val: string): Validator
Parameters
Returns
Validator
public min(val: string): Validator
Parameters
Returns
Validator
Alias for notRegex()
Returns
Validator
public notContains(str: string): Validator
Parameters
Returns
Validator
public notEmpty(): Validator
Not just whitespace (input.trim().length !== 0)
Returns
Validator
public notIn(options: string): Validator
Parameters
Returns
Validator
public notIn(options: Array<string>): Validator
Parameters
Returns
Validator
Check if length is 0
Returns
Validator
public notRegex(pattern: string, modifiers: string): Validator
Parameters
-
pattern: string
-
modifiers: string
Returns
Validator
public regex(pattern: string, modifiers: string): Validator
Usage: regex(/[a-z]/i) or regex('[a-z]','i')
Parameters
-
pattern: string
-
modifiers: string
Returns
Validator