Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Constructors

constructor

Properties

config

defaultLevel

defaultLevel: ValidationLevel

defaultMessage

defaultMessage: string = 'Value needs to match the validation rule.'

patternCache

patternCache: Record<string, RegExp>

Accessors

isRequired

  • get isRequired(): boolean
  • Does the rule make the value required?

    By default, a validation rule does not make the value required.

    Returns boolean

level

  • get level(): ValidationLevel

message

  • get message(): string

Methods

allowAdd

  • allowAdd(value: any): boolean

allowRemove

  • allowRemove(value: any): boolean

Private cachePattern

  • cachePattern(key: string, pattern: string): RegExp

validate

  • validate(value: any): null | string
  • Validates the field using the current value.

    If there is an error with the validation, return an error message string to be displayed to the user.

    Parameters

    • value: any

    Returns null | string

Generated using TypeDoc