Class

MinLengthValidator

MinLengthValidator(messageopt)

Constructor

# new MinLengthValidator(messageopt)

Maximum Length Validator

Validates strings and Arrays on their maximum length

Parameters:
Name Type Attributes Description
message string <optional>

defaults to DEFAULT_ERROR_MESSAGES#MAX_LENGTH

View Source validation/Validators/MaxLengthValidator.ts, line 11

Extends

Methods

# abstract hasErrors(value, optionsopt, proxy) → {string|undefined}

Abstract method that must be implemented by all validator subclasses. This method contains the core validation logic that determines whether a value is valid according to the specific rules of the validator. If the value is valid, the method returns undefined; otherwise, it returns an error message.

Validates a value against specific validation rules

Parameters:
Name Type Attributes Description
value any

The value to validate

options V <optional>

Optional configuration options for customizing validation behavior

proxy PathProxy.<any>
Overrides:
See:
  • Model#validate

View Source validation/Validators/Validator.ts, line 75

Error message if validation fails, undefined if validation passes

string | undefined

MinLengthValidator(messageopt)

Constructor

# new MinLengthValidator(messageopt)

Minimum Length Validator

Validates strings and Arrays on their minimum length

Parameters:
Name Type Attributes Description
message string <optional>

defaults to DEFAULT_ERROR_MESSAGES#MIN_LENGTH

View Source validation/Validators/MinLengthValidator.ts, line 11

Extends

Methods

# abstract hasErrors(value, optionsopt, proxy) → {string|undefined}

Abstract method that must be implemented by all validator subclasses. This method contains the core validation logic that determines whether a value is valid according to the specific rules of the validator. If the value is valid, the method returns undefined; otherwise, it returns an error message.

Validates a value against specific validation rules

Parameters:
Name Type Attributes Description
value any

The value to validate

options V <optional>

Optional configuration options for customizing validation behavior

proxy PathProxy.<any>
Overrides:
See:
  • Model#validate

View Source validation/Validators/Validator.ts, line 75

Error message if validation fails, undefined if validation passes

string | undefined