Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • SchemaGuard

Index

Constructors

constructor

Properties

Private basicAttributeValidator

basicAttributeValidator: BasicAttributeValidator = new GenericAttributeValidator()

Private config

config: any

Methods

Private handleCustomValidation

  • handleCustomValidation(value: string, validated: ValidationResult, attributeConfig: any): void
  • After the validations we check for the custom validation functionality that we support. The user can configure a key which is called "validate". This key has as value an object with 2 keys: 1) validator which is a custom function 2) message which is the custom message to show if the check fails

    Parameters

    • value: string

      The value

    • validated: ValidationResult

      The validation result reference

    • attributeConfig: any

      The configuration

    Returns void

validate

Private validateAttributes

  • This method iterates through all attributes and validates the value based on the configuration. Throws a hard error if the type property doesn't exist since its mandatory

    Parameters

    • attributes: AttributeConfig

      The list of attributes in object [key,value] pair format.

    Returns ValidationResult

    The validation result

Private validateOneToOneRelation

  • This method validates the one to one relation between given attributes and the existing configuration attributes. Generally they should exist both ways, unless specified by the "required" attribute. Required attribute follow the mongoose Schema like way, and is an array with the first parameter being true/false and the second one the error message

    Parameters

    Returns ValidationResult

    The validation result

Private validateValue

  • Validate each value based on its configuration

    Parameters

    • value: string

      The given value

    • attribute: string

      The given attribute

    Returns ValidationResult

    The validation result

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc