• Gets a list of the ranges of placeholders that are included in a string.

    Parameters

    • str: string

      The string to check.

    • Optional options: {
          allPlaceholders?: Placeholder[];
          customPlaceholders?: Placeholder[];
          defaultPlaceholders?: Placeholder[];
          strict?: boolean;
      }

      The options for applying placeholders. Optional.

      • Optional allPlaceholders?: Placeholder[]

        The list of all placeholders (custom and default). Provide this if you have a single list of all placeholders.

      • Optional customPlaceholders?: Placeholder[]

        The list of custom (user-defined) placeholders. Provide this if you have a separate list of custom placeholders.

      • Optional defaultPlaceholders?: Placeholder[]

        The list of default placeholders. Provide this if you have customized the order of default placeholders or added additional defaults.

      • Optional strict?: boolean

        Whether to only include placeholders that are surrounded by double curly braces and match the placeholder regex. Defaults to false (will include placeholders that are not surrounded by double curly braces).

    Returns Promise<{
        placeholder: Placeholder;
        range: PLRange;
    }[]>

    The list of placeholders and their ranges.

Generated using TypeDoc