Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Repeater

Handle repeaters, converts their content and replaces the syntax with them.

export
class

Repeater

Hierarchy

  • Repeater

Index

Constructors

constructor

Properties

Private vars

The variables found within the template file.

type

{ISyntaxVariable}

memberof

Repeater

Methods

generate

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

    memberof

    Repeater

    Parameters

    • text: string

      The text to search for repeaters from.

    Returns string

    The text with converted repeaters.

Private getRepeaterAtIndex

  • Search for repeaters at a specific index.

    memberof

    Repeater

    Parameters

    • repeaters: ISyntaxType[]

      The repeaters to search with.

    • index: number

      The index to search at.

    Returns ISyntaxType

    The repeater at the specific index.

Private getTextToRepeat

  • Get text to repeat from withing the repeater.

    memberof

    Repeater

    Parameters

    • repeater: ISyntaxType

      The repeater with the text to repeat.

    Returns string[]

    The string after it has been repeated.

Private repeatObj

Private repeatRegex

  • Get the number of times to repeat and what to repeat based on the repeater.

    memberof

    Repeater

    Parameters

    Returns RegExpMatchArray

    Number of tiems to repeat and what to repeat.

Private timesToRepeat

  • Get number of times to repeat the repeater's value.

    memberof

    Repeater

    Parameters

    • repeater: ISyntaxType

      The repeater to get the value to repeat.

    Returns number

    The number of times to repeat.

Generated using TypeDoc