Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MetadataStorage

Storage all metadatas.

Hierarchy

  • MetadataStorage

Index

Constructors

constructor

Properties

Private constraintMetadatas

constraintMetadatas: any

Private validationMetadatas

validationMetadatas: any

Accessors

hasValidationMetaData

  • get hasValidationMetaData(): boolean
  • Returns boolean

Methods

addConstraintMetadata

  • addConstraintMetadata(metadata: ConstraintMetadata): void
  • Adds a new constraint metadata.

    Parameters

    • metadata: ConstraintMetadata

    Returns void

addValidationMetadata

  • addValidationMetadata(metadata: ValidationMetadata): void
  • Adds a new validation metadata.

    Parameters

    • metadata: ValidationMetadata

    Returns void

addValidationSchema

  • Adds a new validation metadata.

    Parameters

    Returns void

getTargetValidationMetadatas

  • getTargetValidationMetadatas(targetConstructor: Function, targetSchema: string, always: boolean, strictGroups: boolean, groups?: string[]): ValidationMetadata[]
  • Gets all validation metadatas for the given object with the given groups.

    Parameters

    • targetConstructor: Function
    • targetSchema: string
    • always: boolean
    • strictGroups: boolean
    • Optional groups: string[]

    Returns ValidationMetadata[]

getTargetValidatorConstraints

  • getTargetValidatorConstraints(target: Function): ConstraintMetadata[]
  • Gets all validator constraints for the given object.

    Parameters

    • target: Function

    Returns ConstraintMetadata[]

groupByPropertyName

  • groupByPropertyName(metadata: ValidationMetadata[]): {}
  • Groups metadata by their property names.

    Parameters

    • metadata: ValidationMetadata[]

    Returns {}

    • [propertyName: string]: ValidationMetadata[]

Generated using TypeDoc