output.js
function fixOutputPaths(output, files) {

    // map directories to use for index files
    var dirMap = {};
    u.each(files, function(file) {
      dirMap[ppath.dirname(file.path)] = true;

      // edge case - treat /foo/ as directory too
      if (/\/$/.test(file.path) && ppath.dirname(file.path) !== file.path) {
        dirMap[file.path] = true;
      }
    });

    // default output file extension is .html
    var extension = 'extension' in output ? (output.extension || '') : '.html';
    var indexFile = output.indexFile || 'index';

    u.each(files, function(file) {
      if (dirMap[file.path]) {
        debug('index file for %s', file.path);
        file.path = ppath.join(file.path, indexFile);
      }
      if (!/\.[^/]*$/.test(file.path)) {
        file.path = file.path + extension;
      }
    });
  }
function fixOutputPaths(output, files) {

    // map directories to use for index files
    var dirMap = {};
    u.each(files, function(file) {
      dirMap[ppath.dirname(file.path)] = true;

      // edge case - treat /foo/ as directory too
      if (/\/$/.test(file.path) && ppath.dirname(file.path) !== file.path) {
        dirMap[file.path] = true;
      }
    });

    // default output file extension is .html
    var extension = 'extension' in output ? (output.extension || '') : '.html';
    var indexFile = output.indexFile || 'index';

    u.each(files, function(file) {
      if (dirMap[file.path]) {
        debug('index file for %s', file.path);
        file.path = ppath.join(file.path, indexFile);
      }
      if (!/\.[^/]*$/.test(file.path)) {
        file.path = file.path + extension;
      }
    });
  }
function fixOutputPaths ( output , files ) { // map directories to use for index files var dirMap = { } ; u . each ( files , function ( file ) { dirMap [ ppath . dirname ( file . path ) ] = true ; // edge case - treat /foo/ as directory too if ( / \/$ / . test ( file . path ) && ppath . dirname ( file . path ) !== file . path ) { dirMap [ file . path ] = true ; } } ) ; // default output file extension is .html var extension = 'extension' in output ? ( output . extension || '' ) : '.html' ; var indexFile = output . indexFile || 'index' ; u . each ( files , function ( file ) { if ( dirMap [ file . path ] ) { debug ( 'index file for %s' , file . path ) ; file . path = ppath . join ( file . path , indexFile ) ; } if ( ! / \.[^/]*$ / . test ( file . path ) ) { file . path = file . path + extension ; } } ) ; }
convert file-paths to 'index' files where necessary
convert file - paths to index files where necessary