@untemps/utils - v3.1.0
    Preparing search index...

    Function interpolateLiteral

    • Parameters

      • value: string

        The literal-like string value to interpolate.

      • tokens: Record<string, unknown>

        An object of key/value pairs to replace the tokens.

      Returns string

      The interpolated string.

      import { interpolateLiteral } from '@untemps/utils/string/interpolateLiteral'

      const value = 'A ${foo} with ${bar} "wings" and a lot of ${fun}'
      const tokens = {
      foo: 'bird',
      bar: 3,
      fun: 'dignity'
      }
      interpolateLiteral(value, tokens) // A bird with 3 "wings" and a lot of dignity