Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Variable

Handle variables, converts them to their correct values and so on.

export
class

Variable

Hierarchy

  • Variable

Index

Constructors

constructor

Properties

Private index

index: number = 0

The line index of the text.

type

{number}

memberof

Variable

Private vars

The variables found within the template file.

type

{ISyntaxVariable}

memberof

Variable

Methods

Private createType

  • createType(text: string): string
  • Convert the text line with variables to a strin with the variables converted.

    memberof

    Variable

    Parameters

    • text: string

      The text line to convert the variables within.

    Returns string

    The string with the variables converted.

generate

  • generate(text: string): string
  • Generate the variables, loops through the text by row and search for variables found withing. Handles them if they are found.

    memberof

    Variable

    Parameters

    • text: string

      The text to search for variables from.

    Returns string

    The text with converted variables.

Private getArrayVars

  • Get the variables that are an array.

    memberof

    Variable

    Parameters

    • variables: ISyntaxType[]

      The variables to search from.

    Returns any[]

    The array varibles that has an value of an array.

Private getLocalTypes

  • Get the location of variables in a text.

    memberof

    Variable

    Parameters

    • text: string

      The text to get variables from.

    Returns ISyntaxType[]

    The list of variables with their location.

Private getTypeValue

  • Get the real value of the variable.

    memberof

    Variable

    Parameters

    • variable: ISyntaxType

      The variable to get the converted value from.

    Returns any

    The variable's converted value.

Private getVarName

  • getVarName(variable: string): string
  • Get the variable name from the variable found within the template file.

    memberof

    Variable

    Parameters

    • variable: string

      The variable as it was found within the template file.

    Returns string

    The variables name.

Private maxNumOfType

  • maxNumOfType(vars: any[]): any
  • Get the max length of variables that are an array.

    memberof

    Variable

    Parameters

    • vars: any[]

      The vars to check on.

    Returns any

    Return the variable's array length that has the most elements.

Generated using TypeDoc