Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • OptionApplier

Index

Constructors

constructor

Properties

Protected Optional customValidatorValues

customValidatorValues: any

If set, this holds the values that the custom validator returned This is needed to transfer the values from the custom validator to the value validator. The property is cleaned afterwards

Protected errors

errors: string[] = []

The list of errors we encountered while applying the options

Protected Optional options

The options for the applier

Methods

apply

Protected applyDefaultsFor

  • Is called to apply the default values for a missing key in the given $list

    Parameters

    • list: any[] | PlainObject<any> | Set<any> | Map<any, any>

      The list to add the default value to

    • k: string

      The key to add the default value for

    • def: MakeOptionsValueDefinition

      The definition to read the default value from

    • path: string[]

      The path for the error message or the callback

    Returns void

Protected applyFilter

  • Internal helper to apply the given filter callback

    Parameters

    • k: string

      The key of the value to filter for the callback

    • v: any

      The value to filter

    • def: MakeOptionsValueDefinition

      The definition of the value to filter

    • path: string[]

      The path of the value for the callback

    • list: any[] | PlainObject<any> | Set<any> | Map<any, any>

      The whole list for the callback

    Returns any

Protected applyInternal

Protected applyPreFilter

  • Internal helper to apply the given pre-filter callback

    Parameters

    • k: string

      The key of the value to filter for the callback

    • v: any

      The value to filter

    • def: MakeOptionsValueDefinition

      The definition of the value to filter

    • path: string[]

      The path of the value for the callback

    • list: any[] | PlainObject<any> | Set<any> | Map<any, any>

      The whole list for the callback

    Returns any

Protected checkCustomValidation

  • Internal helper to apply the given, custom validation for a given value

    Parameters

    • k: string

      The key of the value to validate for the callback

    • v: any

      The value to validate

    • def: MakeOptionsValueDefinition

      The definition to validate with

    • path: string[]

      The path of the value for the error message

    • list: any[] | PlainObject<any> | Set<any> | Map<any, any>

      The whole list for the callback

    Returns boolean

Protected checkTypeValidation

  • Internal helper to check the "type" validation of the definition

    Parameters

    • v: any

      The value to validate

    • def: MakeOptionsValueDefinition

      The definition to validate with

    • path: string[]

      The path of the value for the error message

    Returns boolean

Protected checkValueValidation

  • Internal helper to check the "value" validation of the definition

    Parameters

    • v: any

      The value to validate

    • def: MakeOptionsValueDefinition

      The definition to validate with

    • path: string[]

      The path of the value for the error message

    Returns boolean

Protected validateDefinition

Protected validateTypesOf

  • validateTypesOf(v: any, types: Set<number>): boolean
  • Internal helper which validates the type of a given value against a list of valid types

    Parameters

    • v: any

      the value to validate

    • types: Set<number>

      The list of types to validate $value against

    Returns boolean

Generated using TypeDoc