• Applies placeholders to a string by memoizing the results of each placeholder.

    Parameters

    • str: string

      The string to apply placeholders to.

    • Optional options: {
          allPlaceholders?: Placeholder[];
          checkRules?: boolean;
          context?: {
              [key: string]: unknown;
          };
          customPlaceholders?: Placeholder[];
          defaultPlaceholders?: Placeholder[];
      }

      The options for applying placeholders.

      • Optional allPlaceholders?: Placeholder[]

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

      • Optional checkRules?: boolean

        Whether or not to check the rules of each placeholder before applying it.

      • Optional context?: {
            [key: string]: unknown;
        }

        The context to apply placeholders with.

        • [key: string]: unknown
      • 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.

    Returns Promise<string>

    The string with placeholders substituted.

Generated using TypeDoc