How to use the filer.path.join function in filer

To help you get started, we’ve selected a few filer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github humphd / nohost / src / html-formatter.js View on Github external
const rows = entries.map(entry => {
    const ext = path.extname(entry.name);
    // Maintain path sep, but deal with things like spaces in filenames
    const href = encodeURI(`${route}${path.join(dirPath, entry.name)}`);
    let icon;
    let alt;

    // TODO: switch this to entry.isDirectory() if possible
    if (entry.type === 'DIRECTORY') {
      icon = folder;
      alt = '[DIR]';
    } else {
      if (isImage(ext)) {
        icon = image2;
        alt = '[IMG]';
      } else if (isMedia(ext)) {
        icon = movie;
        alt = '[MOV]';
      } else {
        icon = text;