function doReplacement(text, searchValue, replaceValue) {
  const newValue = text.replace(searchValue, replaceValue);
  if (newValue === text) throw new Error(`could not find: ${searchValue}`);
  return newValue;
}
@param {string} text
@param {string|RegExp} searchValue
@param {string} replaceValue