Class Validator

The Validator class is validation of input text.

Hierarchy

Constructors

Properties

Accessors

Methods

Constructors

  • Constructs a validator with a regular expression.

    Parameters

    • Optional pattern: RegExp

    Returns Validator

Properties

m_pattern: RegExp

Accessors

  • get pattern(): RegExp
  • Returns the regular expression of this validator.

    Returns RegExp

  • set pattern(pattern): void
  • Sets the regular expression of this validator to pattern.

    Parameters

    • pattern: RegExp

    Returns void

Methods

  • This function attempts to modify the input to make it valid based on the rules defined by this validator.

    Parameters

    • input: string

    Returns string

  • Returns Invalid if input is invalid according to this validator's rules, and Acceptable if the input is valid.

    Parameters

    • input: string

    Returns ValidatorState

Generated using TypeDoc