Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

  • resolveTemplate(template: string, values: undefined | {}, returnIncompleteResult?: false): string | undefined
  • resolveTemplate(template: string, values: undefined | {}, returnIncompleteResult: true): string
  • Resolves a string template with placeholders on the form ${name} with the values given in an object. E.g. resolveTemplate('Hello ${subject}', {subject: 'world'}) yields 'Hello world'.

    Parameters

    • template: string

      The template string

    • values: undefined | {}

      An object with the key/value pairs to fill out the template with.

    • Optional returnIncompleteResult: false

      Optional. Default false. Determines what to return if not all placeholder values are given in the object. If false, returns undefined. If true, returns a string with some placeholders not replaced; still in their ${...} form.

    Returns string | undefined

  • Resolves a string template with placeholders on the form ${name} with the values given in an object. E.g. resolveTemplate('Hello ${subject}', {subject: 'world'}) yields 'Hello world'.

    Parameters

    • template: string

      The template string

    • values: undefined | {}

      An object with the key/value pairs to fill out the template with.

    • returnIncompleteResult: true

      Optional. Default false. Determines what to return if not all placeholder values are given in the object. If false, returns undefined. If true, returns a string with some placeholders not replaced; still in their ${...} form.

    Returns string