Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • ConditionExpressionBuilder

Index

Methods

Static Private buildBetweenConditionExpression

  • buildBetweenConditionExpression(attributePath: string, namePlaceholder: string, valuePlaceholder: string, attributeNames: object, values: string[], existingValueNames: string[] | undefined, propertyMetadata: PropertyMetadata<any> | undefined): Expression

Static Private buildDefaultConditionExpression

  • buildDefaultConditionExpression(attributePath: string, namePlaceholder: string, valuePlaceholder: string, attributeNames: object, values: any[], existingValueNames: string[] | undefined, propertyMetadata: PropertyMetadata<any> | undefined, operator: ConditionOperator): Expression

Static buildFilterExpression

  • buildFilterExpression(attributePath: string, operator: ConditionOperator, values: any[], existingValueNames: string[] | undefined, metadata: Metadata<any> | undefined): Expression
  • Will create a condition which can be added to a request using the param object. It will create the expression statement and the attribute names and values.

    Parameters

    • attributePath: string
    • operator: ConditionOperator
    • values: any[]

      Depending on the operator the amount of values differs

    • existingValueNames: string[] | undefined

      If provided the existing names are used to make sure we have a unique name for the current attributePath

    • metadata: Metadata<any> | undefined

      If provided we use the metadata to define the attribute name and use it to map the given value(s) to attributeValue(s)

    Returns Expression

Static Private buildInConditionExpression

  • buildInConditionExpression(attributePath: string, namePlaceholder: string, valuePlaceholder: string, attributeNames: object, values: any[], existingValueNames: string[] | undefined, propertyMetadata: PropertyMetadata<any> | undefined): Expression
  • IN expression is unlike all the others property the operand is an array of unwrapped values (not attribute values)

    Parameters

    • attributePath: string
    • namePlaceholder: string
    • valuePlaceholder: string
    • attributeNames: object
      • [key: string]: string
    • values: any[]
    • existingValueNames: string[] | undefined
    • propertyMetadata: PropertyMetadata<any> | undefined

    Returns Expression

Static deepFilter

  • deepFilter(obj: any, filterFn: function): any | null
  • Will walk the object tree recursively and removes all items which do not satisfy the filterFn

    Parameters

    • obj: any
    • filterFn: function
        • (value: any): boolean
        • Parameters

          • value: any

          Returns boolean

    Returns any | null

Static Private validateValueForContains

  • validateValueForContains(value: any, propertyMetadata?: PropertyMetadata<any>): object

Static Private validateValues

  • Every operator requires a predefined arity of parameters, this method checks for the correct arity and throws an Error if not correct

    throws

    {Error} error Throws an error if the amount of values won't match the operator function parameter arity or the given values is not an array

    Parameters

    • operator: ConditionOperator
    • Optional values: any[]

      The values which will be applied to the operator function implementation

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc