docs: function replaceInString(string, variables) {
      const model = createModel(string);
      let offset = 0;
      let output = '';
  
      for (let i = 0, il = model.variables.length; i < il; i++) {
          const v = model.variables[i];
          let value = v.name in variables ? variables[v.name] : v.name;
          if (typeof value === 'function') {
              value = value(model.string, v, offset + v.location);
          }
  
          output += model.string.slice(offset, v.location) + value;
          offset = v.location + v.length;
      }
  
      return output + model.string.slice(offset);
  }