node_modules/connect/node_modules/serve-index/index.js
/**
 * Map html `files`, returning an html unordered list.
 */
Map html `files`, returning an html unordered list.
Map html ` files ` returning an html unordered list .
function html(files, dir, useIcons, view) {
  	return '<ul id="files" class="view-'+view+'">'
    + (view == 'details' ? (
      '<li class="header">'
      + '<span class="name">Name</span>'
      + '<span class="size">Size</span>'
      + '<span class="date">Modified</span>'
      + '</li>') : '')
    + files.map(function(file){
    var isDir = '..' == file.name || (file.stat && file.stat.isDirectory())
      , classes = []
      , path = dir.split('/').map(function (c) { return encodeURIComponent(c); });
    if (useIcons) {
      var ext = extname(file.name);
      ext = isDir ? '.directory' : (icons[ext] ? ext : '.default');
      classes.push('icon');
      classes.push('icon-' + ext.substring(1));
    }
    path.push(encodeURIComponent(file.name));
    var date = file.name == '..' ? ''
      : file.stat.mtime.toDateString()+' '+file.stat.mtime.toLocaleTimeString();
    var size = isDir ? '' : file.stat.size;
    return '<li><a href="'
      + normalizeSlashes(normalize(path.join('/')))
      + '" class="'
      + classes.join(' ') + '"'
      + ' title="' + file.name + '">'
      + '<span class="name">'+file.name+'</span>'
      + '<span class="size">'+size+'</span>'
      + '<span class="date">'+date+'</span>'
      + '</a></li>';
  }).join('\n') + '</ul>';
}
function html ( files , dir , useIcons , view ) { return '<ul id="files" class="view-' + view + '">' + ( view == 'details' ? ( '<li class="header">' + '<span class="name">Name</span>' + '<span class="size">Size</span>' + '<span class="date">Modified</span>' + '</li>' ) : '' ) + files . map ( function ( file ) { var isDir = '..' == file . name || ( file . stat && file . stat . isDirectory ( ) ) , classes = [ ] , path = dir . split ( '/' ) . map ( function ( c ) { return encodeURIComponent ( c ) ; } ) ; if ( useIcons ) { var ext = extname ( file . name ) ; ext = isDir ? '.directory' : ( icons [ ext ] ? ext : '.default' ) ; classes . push ( 'icon' ) ; classes . push ( 'icon-' + ext . substring ( 1 ) ) ; } path . push ( encodeURIComponent ( file . name ) ) ; var date = file . name == '..' ? '' : file . stat . mtime . toDateString ( ) + ' ' + file . stat . mtime . toLocaleTimeString ( ) ; var size = isDir ? '' : file . stat . size ; return '<li><a href="' + normalizeSlashes ( normalize ( path . join ( '/' ) ) ) + '" class="' + classes . join ( ' ' ) + '"' + ' title="' + file . name + '">' + '<span class="name">' + file . name + '</span>' + '<span class="size">' + size + '</span>' + '<span class="date">' + date + '</span>' + '</a></li>' ; } ) . join ( '\n' ) + '</ul>' ; }
Map html `files`, returning an html unordered list.
Map html ` files ` returning an html unordered list .