code: function rewriteJSONFile(filePath, rewriteFile, generator) {
      const jsonObj = generator.fs.readJSON(filePath);
      rewriteFile(jsonObj, generator);
      generator.fs.writeJSON(filePath, jsonObj, null, 2);
  }
docs: Rewrite JSON file
  
  @param {string} filePath file path
  @param {function} rewriteFile rewriteFile function
  @param {object} generator reference to the generator