Class

Validation

Validation()

Constructor

# new Validation()

Static class acting as a namespace for the Validation

View Source validation/Validation.ts, line 4

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 113

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 36

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 129

# static keys()

Returns all registered validation keys

View Source validation/Validation.ts, line 134

# 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 121

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 97