Options
All
  • Public
  • Public/Protected
  • All
Menu

Class VariableTranslator

Translator for the Variable class.

export
class

VariableTranslator

Hierarchy

  • VariableTranslator

Index

Constructors

constructor

Properties

Private varName

varName: string

The name of the variable.

type

{string}

memberof

VariableTranslator

Private varValue

varValue: string

The value of the variable as seen in the template file.

type

{string}

memberof

VariableTranslator

Methods

Private handleFunction

  • handleFunction(func: string, value: any): any
  • Applies the function to the value..

    memberof

    VariableTranslator

    Parameters

    • func: string

      The function to apply.

    • value: any

      The value to apply to.

    Returns any

    The value with the applied function.

Private handleProperty

  • handleProperty(prop: string, value: any): any
  • Applies the property to the value..

    memberof

    VariableTranslator

    Parameters

    • prop: string
    • value: any

      The value to apply to.

    Returns any

    The value with the applied property.

Private isAdvancedSyntax

  • isAdvancedSyntax(text: string): RegExpMatchArray
  • Check if text has an advanced syntax. If it includes any functions or properties.

    memberof

    VariableTranslator

    Parameters

    • text: string

      The text to match.

    Returns RegExpMatchArray

    The match. If the match is not empty it will be used as true.

translate

  • translate(text: string): any
  • Translate a variable.

    memberof

    VariableTranslator

    Parameters

    • text: string

      The text to translate.

    Returns any

    The value of the translated variable.

Generated using TypeDoc