ResponseTranslator class

Constructors

Methods

Constructors

Methods

  • Finds a match in the given text and performs replacements based on patterns and placeholders.

    This function searches for a specified regular expression pattern in the provided text and performs replacements based on the matched pattern, command data, and placeholder values.

    Parameters

    • regex: string

      The regular expression pattern to search for.

    • newraw: string

      The input text where the match will be searched for.

    • val: string

      The value to be used in replacement if a match is found.

    • cmd: any = {}

      The command data containing replacements, if applicable.

    • ph: any = {}

      An array of placeholder values for further replacements.

    Returns string

    Returns non-empty string if replacements were performed, empty string otherwise.

  • translate a raw api response

    Parameters

    • raw: string

      API raw response

    • cmd: any

      requested API command

    • ph: any = {}

      list of place holder vars

    Returns string

    new translated raw response