function mergeStringWithValues(string, values) {
  // get properties in values
  let properties = Object.keys(values)

  properties.forEach(function (property) {
    // escape regex
    let sanitisedProperty = property.replace(/([.*+?^=!:${}()|[\]/\\])/g, '\\$1')
    sanitisedProperty = '{' + sanitisedProperty + '}'

    // build regex
    let exp = RegExp(sanitisedProperty, 'g')

    // replace instances of property placeholder with value
    string = string.replace(exp, values[property])
  })

  return string
}
Substitutes the placeholders in the string using the provided values.

@param {String} string - String with placeholders in the {placeholder} format.
@param {Object} values - Object with values to substitute for placeholders.
@returns {String} - String with placeholders substituted for values.