• Applies placeholders to the value of a single key in an object.

    Parameters

    • obj: {
          [key: string]: unknown;
      }

      The object to apply placeholders to.

      • [key: string]: unknown
    • key: string

      The key of the value 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 | string[] | {
        [key: string]: unknown;
    }>

    The object with placeholders applied.

Generated using TypeDoc