Options
All
  • Public
  • Public/Protected
  • All
Menu

Condition engine

Hierarchy

  • default

Index

Constructors

  • new default(options?: Partial<Options>): default
  • Parameters

    • Optional options: Partial<Options>

      Parser options.

    Returns default

Properties

parser: Parser

Methods

  • evaluate(exp: ExpressionInput, ctx: Context): boolean
  • Evaluate the expression.

    Parameters

    • exp: ExpressionInput

      Raw expression.

    • ctx: Context

      Evaluation data context.

    Returns boolean

  • parse(exp: ExpressionInput): Evaluable
  • Parse expression.

    Parameters

    • exp: ExpressionInput

      Raw expression.

    Returns Evaluable

  • simplify(exp: ExpressionInput, context: Context, strictKeys?: string[], optionalKeys?: string[]): Input
  • Simplifies an expression with values in context.

    This method tries to evaluate all the expressions and reduce them to its corresponding boolean value. If a value required for the expression is not present in the context, the minimal corresponding expression will be returned.

    Parameters

    • exp: ExpressionInput

      Raw expression.

    • context: Context

      Evaluation data context.

    • Optional strictKeys: string[]

      keys to be considered present even if they are not present in the context

    • Optional optionalKeys: string[]

      keys to be considered not present unless they are in the context or in strictKeys; when strictKeys is undefined and optionalKeys is an array, every key that is not in optionalKeys is considered to be present and thus will be evaluated

    Returns Input

  • statement(exp: ExpressionInput): string
  • Get expression statement

    Parameters

    • exp: ExpressionInput

      Raw expression.

    Returns string

Generated using TypeDoc