Options
All
  • Public
  • Public/Protected
  • All
Menu

Validation result set.

Hierarchy

  • default

Index

Constructors

  • new default(parameter?: string | string[], finalValue?: string | number | boolean | Date | (undefined | string | number | boolean | Date)[], results?: IValidationError[]): ValidationResult.default

Properties

finalValues: (undefined | string | number | boolean | Date)[]
parameters: string[]
results: IValidationError[]

Methods

  • deepen<T>(obj: Record<string, unknown>): T
  • Deepen a dot-notated nested object into a real nested object.

    Type parameters

    • T = Record<string, unknown>

    Parameters

    • obj: Record<string, unknown>

      Object with dot-notated nested properties

      const dotNotated = { "nested.prop": "value" };
      const deepened = this.deepen(dotNotated);
      console.log(deepened); // { 'nested': { 'prop': 'value' }}

    Returns T

  • hasErrors(): boolean
  • passedData<T>(): T
  • Return final values that have been stored within this validation result. This can be used for retrieving all values that have passed validations and been sanitized.

    Type parameters

    • T = Record<string, unknown>

    Returns T

Generated using TypeDoc