Class

Validation

Validation()

Constructor

# new Validation()

Static class acting as a namespace for the Validation

View Source validation/Validation.ts, line 6

Methods

# static get(validatorKey) → {Validator|undefined}

Retrieves a validator

Parameters:
Name Type Description
validatorKey string

one of the ValidationKeys

View Source validation/Validation.ts, line 120

the registered Validator or undefined if there is nono matching the provided key

Validator | undefined

# static getRegistry()

Returns the current ValidatorRegistry

View Source validation/Validation.ts, line 37

IValidatorRegistry, defaults to ValidatorRegistry

# static key(key)

Builds the key to store as Metadata under Reflections

concatenates ValidationKeys#REFLECT with the provided key

Parameters:
Name Type Description
key string

View Source validation/Validation.ts, line 136

# static keys()

Returns all registered validation keys

View Source validation/Validation.ts, line 141

# static register(validator) → {void}

Registers the provided validators onto the registry

Parameters:
Name Type Description
validator Array.<T> | Array.<ValidatorDefinition>

View Source validation/Validation.ts, line 128

void

# static setRegistry(validatorRegistry, migrationHandleropt)

Defines the acting ValidatorRegistry

Parameters:
Name Type Attributes Description
validatorRegistry IValidatorRegistry

the new implementation of the validator Registry

migrationHandler function <optional>

the method to map the validator if required;

View Source validation/Validation.ts, line 104