code: function handleFile(dir, options) {
    return filename => {
      const file = parseFile(dir, filename);
  
      debug(`found "${filename}"`);
  
      // Exit early if this item is not a file.
      if (!file.stat.isFile()) {
        debug(`skipped "${filename}" (not a file)`);
        return;
      }
  
      // Exit early if this item is not the right file type.
      if (!options.extensions.includes(file.ext)) {
        debug(`skipped "${filename}" (incorrect file type)`);
        return;
      }
  
      registerTask(file, options);
    };
  }
docs: Creates a closure that is invoked for each item in the chosen directory.
  Verifies that the item is a file and of the correct type, then registers
  the task.
  
  @param {string} dir
  @param {Object} options
  @returns {Function}