code: function processFunctionFactory (
    basePath, relativePath, packagedPath, list, properties, filtered, packaged) {
    /**
     * @param {!(string|Buffer)} fileContent
     * @param {!string} filePath
     * @returns {!Buffer}
     */
    return function (fileContent, filePath) {
      let targetRelativeFilePath = path.relative(basePath, filePath);
      trace('Target relative file path: %s', targetRelativeFilePath);
      const filesetRelativeFilePath = path.relative(relativePath, targetRelativeFilePath);
      trace('Fileset relative file path %s', filesetRelativeFilePath);
      if (packaged) {
        trace('Repackaging');
        const postPackage = path.relative(relativePath, targetRelativeFilePath);
        targetRelativeFilePath = path.join(relativePath, packagedPath, postPackage);
        trace('Target relative file path with packaging info included', targetRelativeFilePath);
      }
      debug('Copying %s with size %d', filesetRelativeFilePath, fileContent.length);
      list.push(targetRelativeFilePath);
      if (filtered) {
        trace('Filtering', targetRelativeFilePath);
  
        const strFileContent = (fileContent instanceof Buffer ? fileContent.toString() : fileContent);
        const newFileContent = fileFiltering.filter(strFileContent, properties);
        trace('Filtered');
  
        return newFileContent;
      }
      return fileContent;
    };
  }
docs: This is a helper that is used to produce a function that is passed to mem-fs-editor.copy() so we can
  capture all of the files that are copied and also so that we can perform content filtering in-place.
  
  @param {!string} basePath is the root directory we are copying from
  @param {!string} relativePath relative path from basePath to where fileset matches
  @param {!string} packagedPath package in path form we can inject when packaged is true
  @param {!Array<string>} list holds files copied relative to basePath
  @param {!Object} properties holds key/value pairs that are replaced when filtered is true
  @param {!boolean} filtered is a flag
  @param {!boolean} packaged is a flag
  @returns {!Function}